Skip to Main Content
Coding with JavaScript For Dummies
book

Coding with JavaScript For Dummies

by Chris Minnick, Eva Holland
May 2015
Beginner content levelBeginner
360 pages
6h 39m
English
For Dummies
Content preview from Coding with JavaScript For Dummies

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HTML5 Programming with JavaScript For Dummies

HTML5 Programming with JavaScript For Dummies

John Paul Mueller
JavaScript For Kids For Dummies

JavaScript For Kids For Dummies

Chris Minnick, Eva Holland

Publisher Resources

ISBN: 9781119056072Purchase book