I'm adding a DIV with JavaScript .createElement..., I do a setAttribute("class", "someCSS"); so far, so good.

Now, in my "someCSS" I got a working :hover where it changes the text color and background color, so far, so good.

If I use this "someCSS" in a static way, when I hover my mouse both background and color changes on hover.

But when I add a DIV with same "someCSS" class, the text color changes on hover, but not the background!

 

I tested to add a DIV with createElement and set a style to it with background, same problem. The div shows up but without background.

 

Anyone got any idéa what I'm doing wrong here?