Skip to content

Firefox 3.5 not collapsing spaces in JavaScript className

In JavaScript, to get all the classes on a given element, you call element.className, which gives a string with space-separated classes, such as “class1 class2”. You can also set this property directly, such as element.className = “class3 class4”. The norm here is that classes are separated by a single space, with no whitespace [...]