Hour 13. JavaScript and CSS

What You’ll Learn in This Hour

• Separating style from content

• The DOM style property

• Retrieving styles

• Setting styles

• Accessing classes using className

• The DOM styleSheet object

• Enabling, disabling, and switching stylesheets in JavaScript

• Changing the mouse cursor

In the early days of the World Wide Web, pages were all about their text content. Early browsers had rudimentary support for graphic effects—some didn’t even support images. Styling a web page was largely a matter of using the few style-related attributes and tags allowed by the early incarnations of HTML.

Things improved markedly with the introduction of browser support for Cascading Style Sheets (CSS), which allowed the styling of a page ...

Get Sams Teach Yourself JavaScript™ in 24 Hours, Fifth Edition now with O’Reilly online learning.

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