Presentation and Behavior (CSS and Event Handling)

In the last chapter, you took apart an HTML document to see what was under the hood. You fiddled with some of the cables, exchanged some parts, and got the engine in pristine condition. Now it is time to take a look at how to give the document a new lick of paint with Cascading Style Sheets (CSS) and kick-start it via events. If beauty is what you are after, you are in luck, because we start with the presentation layer.

Changing the Presentation Layer via JavaScript

Every element in the HTML document has as one of its properties a style attribute that is a collection of all its visual ...

Get Beginning JavaScript with DOM Scripting and Ajax, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.