I am trying to remove certain values from an array containing input fields in a form:
allFields = theForm.getElementsByTagName("INPUT"); for(j = 0; j < allFields.length; j++) { if(allFields[j].className == "btn" || allFields[j].className == "lnk") { allFields.splice(j,1); } }
It causes an error. Firebug shows following error and the script doesn't work.
allFields.splice is not a function
This also happened with any other Array method I tried. How can I fix this?