Seems like you can use the same Array.prototype.slice.call that makes the args array-like object become an array. (See here)
var inputs = document.getElementsByTagName('input');
var selects = document.getElementsByTagName('select');
inputs = Array.prototype.slice.call(inputs);
selects = Array.prototype.slice.call(selects);
var res = inputs.concat(selects);
alert(res.length);
Related Contents:
- forEach method of Node.childNodes?
- How can I change an element’s class with JavaScript?
- jQuery .live() vs .on() method for adding a click event after loading dynamic html
- How do I check if an element is hidden in jQuery?
- Creating a new DOM element from an HTML string using built-in DOM methods or Prototype
- How to pass arguments to addEventListener listener function?
- Get selected text from a drop-down list (select box) using jQuery
- How to resolve the C:\fakepath?
- For loop for HTMLCollection elements
- Detect element content changes with jQuery
- Event handlers inside a Javascript loop – need a closure?
- When should I use jQuery’s document.ready function?
- How to get element by class name? [duplicate]
- How can I count text lines inside an DOM element? Can I?
- Chrome extension – retrieving global variable from webpage
- jQuery object and DOM element
- Find an element in DOM based on an attribute value
- How do I toggle an element’s class in pure JavaScript?
- How to get the element clicked (for the whole document)?
- Browser-independent way to detect when image has been loaded
- Replace HTML page with contents retrieved via AJAX
- Is there a DOM event that fires when an HTML select element is closed?
- How to remove only the parent element and not its child elements in JavaScript?
- Javascript – Are DOM redraw methods synchronous?
- Intercept paste event in Javascript
- How to check if element has any children in Javascript?
- DOM refresh on long running function
- What is the difference between Document and document in JavaScript?
- How to find a parent with a known class in jQuery?
- jQuery count child elements
- Check if option is selected with jQuery, if not select a default
- getElementsByName in IE7
- How to get the title of HTML page with JavaScript?
- How to retrieve the element where a contextmenu has been executed
- How do you listen / detect changes to an input value – when the input value is changed via javascript?
- Why aren’t some technically serializable input properties serializable?
- Get the string representation of a DOM node
- JavaScript moving element in the DOM
- Is there any way of passing additional data via custom events?
- Adding images to an HTML document with JavaScript
- Can I change an HTML element’s type?
- JavaScript: How to get parent element by selector?
- Focus Input Box On Load
- Should I use document.createDocumentFragment or document.createElement
- Why does getElementById not work on elements inside the document element? [duplicate]
- Select div using wildcard ID
- How to fill in form field, and submit, using javascript?
- How to inherit from the DOM element class
- Open new window without focus on it [duplicate]
- How do I capture a CTRL-S without jQuery or any other library?