[Javascript] removeAttribute issue IE7

jeffrey morin rufus2021 at gmail.com
Mon Apr 19 12:11:35 CDT 2010


Hey everyone,

I am editing a script that is having issues in IE7 and can't figure this
out. A radio button has an onclick event handler and when it is fired it
calls a script that removes a class name from a div element. For whatever
reason it doesn't work for IE7 though.

It is very straight forward and says just this.

var div = document.getElementById('div')
div.removeAttribute('class')

I threw an alert in there to give the class name and Ie returns it as null.
The weird thing is that when I just use div.className = ' ' it works just
fine. Does anyone know what is going on here? I am stumped.

Thanks,
- J


More information about the Javascript mailing list