Monday, 7 February 2011

IE6 problems with setAttribute

This was so annoying!

I could *not* figure out why a piece of code wasn't working. Then someone pointed out that:

newLink.setAttribute('class', 'myClassName');

is notoriously flakey in IE6. Change it to:

newLink.className = 'myClassName';

and it all works fine and dandy.

God I hate IE6!!