setAttribute(‘class’) and IE

What happens on IE, our favorite browser, when you try to setup a class attribute on a DOM element? Actually this is not possible, because setAttribute(‘class’, ‘my-class’) is obviously working only on non-IE browsers.

On IE actually you should setup the class on an element with that structure:

element.setAttribute('className', 'my-class');

One thought on “setAttribute(‘class’) and IE

  1. Сайт отличный. Надо бы Вам награду вручить за него или просто почетный орден. =)

Leave a Reply

Your email address will not be published. Required fields are marked *