I have a Web page that runs properly with IE 9 with the following code:

// Check for IE
   if (isBrowserIE) tempArray[i].setAttribute("className", "red");
   else tempArray[i].setAttribute("class", "red");
I have now created a new (separate) page that uses the SAME code--in fact, I did a copy and paste of the whole function containing this code segment from the page that works into the new page. However, the function (this if-statement in particular) does not work in the new page--the new page does NOT make the array item red. Thus using the same identical code, the older page worked (turned the text red) while the newer page did not.

This would seem to be an impossible scenario. Any ideas?

Incidently, the new page works on IE if I change "className" to "class". But if this is required to make the code work on the new page, then the older page that still has "className" should not work, but it does!

Thanks so much.