WDI Fundamentals Unit 10
Here's the starter code for your next exercise. If you don't see the JS Bin below, please refresh the page.
Let's get some practice manipulating the DOM and adding some interactions to our reading list.
Let's get started!
We've finished reading The Wind Up Bird Chronicle and A Visit From the Goon Squad! Use the
getElementsByClassName() to find all elements with the
current class. Then, use a
for loop to iterate through these elements and change the class name to
Now, on to our next book on the reading list, The Flamethrowers. Use the
getElementById() method to find that list item. Update its class name to
current. Then, use the
removeAttribute() method to remove the
Now, find the fourth list item and update the
id attribute to
next using the
When a user clicks on the button with the ID
chill, loop through all list items and add the class
cool to each. Test it out! Each list item should have a blue border after the user clicks on its button.
Feeling confident? Test your understanding of functions and the DOM with this next quiz.