View Full Version : removing elements from an objectHTMLCollection

12-03-2005, 08:01 AM
I have an array of input objects, and need to remove some depending on the value of their attributes. When I try inputArray.splice(), however, I am told that that is not a function. How do I remove elements from an objectHTMLCollection?

*MUST work in IE; FF would be nice too (but not necessary)

12-03-2005, 08:27 AM
HTMLCollection.prototype.splice = Array.prototype.splice

Might actually make it work in Firefox. More generally, however, say:

var collection = [object HTMLCollection] // reference to your collection

// delete the 6th element