Hands On: Changing the DOM

In this lesson, we'll learn how to manipulate the DOM. Let's begin!

The previous exercise did not carry out any useful activity that gets us closer to the page functionality; it only demonstrated that you can easily query the DOM. To achieve our goal, we need to extend the current document with plus and minus signs that indicate the state of a heading (collapsed, or expanded, respectively). The markup of the first header looks like this:

Get hands-on with 1400+ tech skills courses.