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

Using Class Names

Next, elements can be located by an associated CSS class selector. Class selectors can have a complex syntax. Here, we use only the simple form of class names.

The example retrieves all elements that use the CSS class textβ€”which is done by the 3 paragraphs of the first div. Please note that the other paragraphs are not retrieved.

function show() {
 "use strict";
 let elemArray = ...