TOC PREV NEXT INDEX

Put your logo here!


className


This property gets/sets the class of the current element

Syntax

name = element.className 
element.className = name 

Parameters

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

html


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX