Javascript - Concatenate Multiple NodeLists Together
- by Emtucifor
I was originally asking for an elegant way to simulate the Array.concat() functionality in IE or older browsers, because it seemed that concat was not supported. Only, of course it is and the reason the object didn't support it is because it wasn't an array. Oops!
getElementsByTagName returns a NodeList, not an array. The real question, then, is: what's a good way to get a single list of all the form elements in a document (input, select, textarea, button) to loop through them? An array isn't required... a single NodeList would be perfect, too.
Note that I'm using IE6 as this is for a corporate intranet (soon IE8 though).