im trying to hide a series of elements with the .each function replacing a for loop which wasn’t working in IE9, while the code works in FF it wont work in IE.
var myArray=document.getElementsByName("hide[]");
$.each(myArray, function(i, id) {$("#" + myArray[i].attributes["id"].value).hide();});
not entirely sure whats failing
in for loop form
for (var i = 0; i < myArray.length; i++)
{
$("#" + myArray[i].attributes["id"].value).hide();
}
Why are you using
getElementsByName? Just use jQuery to get the elements, then just.hidethem.