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