css class from js code example
Example 1: javascript add class to element
var someElement= document.getElementById("myElement");
someElement.className += " newclass";//add "newclass" to element (space in front is important)
Example 2: syntax for manipulating a class in css
//element
element {
}
//class
.class {
}
//ID
#id {
}
//element and class
element .class {
}
//element with class and decendent
element.class decendent {
}