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

setAttribute to set className is unreliable on IE (depending on the version), if you go this route you have to set both class and className attributes, it's better to just use the .className property, also possibly faster.