O'Reilly logo

Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition by Robin Nixon

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 20. Accessing CSS from JavaScript

With a good understanding of the Document Object Model (DOM) and CSS now under your belt, you’ll learn in this chapter how to access both of these directly from JavaScript, enabling you to create highly dynamic and responsive websites.

I’ll also show you how to use interrupts so that you can create animations or provide any code that must continue running in the background of a web page, such as a clock, and I’ll explain how you can add new elements to or remove existing ones from the DOM so that you don’t have to precreate elements in HTML just in case JavaScript may need to access them later.

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