In the previous chapter, I explained how you can dynamically change the HTML content using JavaScript. There are methods available to create new DOM elements as well as to rearrange or modify the existing elements. Similar capability exists for modifying the styling of those elements. In this chapter, I will describe four techniques that you can use to dynamically change the style rules using JavaScript:
replacing style sheets
changing the style rules
modifying the CSS classes
adjusting inline styles
These scenarios provide increasingly finer control of the styles applied ...