From the course: JavaScript: Ajax and Fetch
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Challenge: Modify the DOM - JavaScript Tutorial
From the course: JavaScript: Ajax and Fetch
Challenge: Modify the DOM
(techno upbeat music) - It's time for another challenge. Ready to try your hand at adding content to the DOM? To complete this challenge, write code that adds information for the first park in the return data to the DOM. You'll add the full park name as the content of the a element in the special section. You'll add the park url as its href value. Then you'll show the park description as the content of the p element. Update the function call to respond to the DOMContentLoaded event on the Window object. For an extra challenge, update your code to display data for a random park in the results rather than always displaying the first one. This challenge might take you around 20 minutes. If you don't have time for that right now, feel free to come back to it later on. When you're done, join me in the next video and I'll go over how I approached it.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
What is the DOM?3m 19s
-
(Locked)
Select elements with vanilla JavaScript3m 43s
-
(Locked)
Request data in response to an event4m 14s
-
(Locked)
Add an event listener2m 12s
-
(Locked)
Work with JSON data6m 52s
-
(Locked)
Modify form values with vanilla JavaScript4m 58s
-
(Locked)
Modify element content with vanilla JavaScript5m 49s
-
(Locked)
Challenge: Modify the DOM58s
-
(Locked)
Solution: Modify the DOM7m 55s
-
-
-
-
-