Chapter 5. Dynamically Modifying Style and Cascading Style Sheets

In Chapter 1, I stressed the importance of separating your markup, behavior, and presentation. The problem with separating everything is that many aspects of the three layers overlap or even collide in an explosion messed-up code. You've already seen how to manipulate the DOM document structure in Chapter 3 and the behavioral event listeners in Chapter 4. Now it's time to discuss the presentation layer and how you can write scripts to modify your presentation. We'll explore ways to modify the presentation without embedding it in the script itself, though sometimes doing so will be unavoidable.

In this chapter, we'll briefly look at the key parts of the W3C DOM Level 2 Style specification ...

Get AdvancED DOM Scripting: Dynamic Web Design Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.