Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 9: Understanding the Document Object Model (DOM) with JavaScript!

Instruction

Navigating the DOM Tree

You can navigate in the DOM tree in the direction from the root to the leaves. This is done by locating an element and using this node as the new root for the following navigation steps.

function show() {
 "use strict";
 // start at 'div_2'
 const elem_1 = document.getElementById("div_2");
 // use this element as the new root for further selections
 const elemArray = elem_1.getEl...