className
This property gets/sets the class of the current element
Syntax
name = element.className element.className = nameParameters
name is a string representing the class of the current element.
Example
el = document.getElementById("div1"); if (el.className == "fixed") { // skip a particular class of element goNextElement(); }
Notes
The name className is used for this property instead of "class" because of conflicts with the "class" keyword in many languages which use the DOM.
Specification
className
Netscape Communications http://developer.netscape.com |