DOMでオブジェクトを特定したり、変更するのに使用するgetAttribute、setAttributeメソッドですが、一部IEにバグがあります。 以前散々悩んだので書いておきます。 たとえば、class名を取得したいとき、 element.getAttribute("class");だと、IEでは取得できません。 IEの場合には element.getAttribute("className"); getAttribute("String")のStringには属性名がくるので、実際にはclassが正しいのですがIEのバグです・・・ また、同様に element.setAttribute("style", "color: #ffffff;");もIEではセットできないので、 element.style.cssText = "color: #ffffff;"; とする必要があります。 さらに
![IEでのgetAttribute,setAttributeのバグ](https://cdn-ak-scissors.b.st-hatena.com/image/square/126e9c63960837b5815901e11e1f6c1303c17f2b/height=288;version=1;width=512/https%3A%2F%2Fblog.seesaa.jp%2Fimg%2Fogp_logo.png)