O'Reilly logo

Beginning JavaScript with DOM Scripting and Ajax, Second Edition by Christian Heilmann, Russ Ferguson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 5

image

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required