Changing Classname Issue (javascript And Ie)
The following javascript code does not work correctly. (I am using IE9 and cannot use a different browser or JQuery): var elems = document.getElementsByClassName('EditableTextBox')
Solution 1:
The getElementsByClassName
seems to return a live set, so when you change the class of any item the set gets updated immediately, and it will skip each other item. Do the loop in reverse instead:
for (var i = elems.length - 1; i >= 0; --i) {
elems[i].className = "Zero";
}
Post a Comment for "Changing Classname Issue (javascript And Ie)"