fix use of setAttribute/getAttribute for setting className on Element in...

setAttribute to set className is unreliable on IE (depending on the version, there is also history of browser vendors juggling with the way get/setAttr work with class), the correct way to do this is to use the .className property, it is also possibly faster.