O'Reilly logo

JavaScript: Novice to Ninja by Darren Darren Jones Jones

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 6The Document Object Model

The Document Object Model (DOM) allows you to access elements of a web page and enable interaction with the page by adding and removing elements, changing the order of elements, changing the content of elements, changing element attributes, and even altering how elements are styled.

In this chapter, we’ll be cover these topics:

  • introduction to the DOM

  • getting elements―getElementById, getElementsByClassName, getElementsByTagName, querySelector, and querySelectorAll

  • navigating the DOM tree

  • getting and setting an element’s attributes

  • updating the DOM by creating dynamic markup

  • changing the CSS of an element

  • our project―insert questions dynamically into the DOM to create a list of quiz questions

The Document ...

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