From the course: Vanilla JavaScript: Building on the Document Object Model (DOM)

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Challenge: queryAll++

Challenge: queryAll++

(upbeat music) - So the querySelector demo we built is nice, but it could be even nicer. So I've added a feature to highlight the selected elements in the output DOM tree. So if I search for, let's say image tags, you'll see there's a little yellow border around this image here. If I search for, let's say hyperlinks. I'll search for that. You can see now all the hyperlinks are selected with that yellow background. So your challenge, should you choose to accept it, is to add that feature to the QueryAll code you'll find in chapter one, 0105 folder of the project files. And I also used one of the less known HTML5 elements to hide the match list. So I didn't have to scroll past it every time when I wanted to see my results. So if you want some extra credit, you can do that too. And don't feel that your solution has to look exactly like mine. If you have a different, better way to differentiate the selected elements…

Contents