Ie7 And Setattribute() To Remove Classes
I've got a pretty interesting issue. I'm writing a plugin which allows you to zoom in/out an image. I've got 3 buttons: close (close the 'window'), zoom in, zoom out. The buttons z
Solution 1:
setAttribute()
and getAttribute()
are generally broken in IE 7 and earlier (and compatibility modes in later versions). Use the element's className
property instead:
elementZoomButtonIn.className = "zoom-icon zoom-icon-small zoom-button-in";
Even if setAttribute()
and getAttribute()
weren't broken in IE, it's still generally easier and more reliable to use equivalent DOM properties instead.
Post a Comment for "Ie7 And Setattribute() To Remove Classes"