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');