Over a million developers have joined DZone.

Dynamic Modification Of CSS Class Properties

DZone's Guide to

Dynamic Modification Of CSS Class Properties

· ·
Free Resource
Modifying the rendering of an element with an ID is relatively easy using document.getElementById.  Modifying the attributes fo an entire class dynamically is a little more code, but the DOM does provide the means to do it through the stylesheet object; with some cross-browser variations.  

For additional CSS and HTML see some of the full length articles
 Written by IT professionals from Experts Round Table



click here

hello world. All of your bases are belong to us.
Notice that the color of the text in the span is not changed, because the inline style prevails over the class in the stylesheet. This technique can be used to make on the fly changes to the look and feel of a page in response to events or user input.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}