The most commonly used way to apply CSS to an HTML page is by using classes. With JavaScript, the class for every element can be accessed with the className property. The following code implements the preceding phrase with the class approach: Changing the CSS Class (classname.html)
The preceding code changes the class for the text every second. |