Chapter 13

Working with CSS and Graphics

In This Chapter

arrow Editing styles

arrow Employing images

arrow Executing JavaScript animations

arrow Developing a slideshow

To achieve style, begin by affecting none.

— E.B. White, The Elements of Style

Once you understand how to manipulate the DOM objects using JavaScript, web pages change from static documents into interactive applications that can respond to user input, change without reloading, and deliver live data to a variety of different computing devices.

Using the Style Object

The DOM’s Style object is a powerful tool for making a web page change its look and adapt in real time to user input or current browser conditions. The Style object gives programmers access to CSS style properties for any selected element or collection of elements in a document. (For more on the basic rules and syntax of CSS, see Chapter 1.)

Some of the things that you can do with the Style object are

  • Change text colors to highlight keywords entered into search boxes
  • Animate an object after a user clicks on it
  • Change the border and background color of the part of ...

Get Coding with JavaScript For Dummies 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.