$className.add
Add a class name for a element.
$className.add( element, name )
element [object]
The target element.name [string]
The target class name.
Notes
This function is useful to add class name for element to attach CSS class style to it.
Example
HTML code
<div id="box1">This is a box</div> <button onclick="start_class_add()">Add class name to the box</button>
CSS code
.box {
width: 200px;
height: 60px;
font-size: 12px;
background: #5599bb;
padding: 10px;
}JavaScript code
function start_class_add()
{
$className.add( $("box1"), "box" );
}
Demonstration
This is a box