scrimba
JavaScript Challenges
Build a Search Bar: Get all the names from the DOM
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Build a Search Bar: Get all the names from the DOM
AboutCommentsNotes
Build a Search Bar: Get all the names from the DOM
Expand for more info
index.js
run
preview
console
/*
Task: Get all the name elements from the DOM
1. Create a new 'let' called 'allNamesDOMCollection'
2. Store all the elements of classname 'name' in 'allNamesDOMCollection'
3. Log to the console 'allNamesDOMCollection' to demonstrate that an HTMLCollection exists
4. Log out the first index of allNamesDOMCollection and add 'textContent' to view a name
*/
document.getElementById("searchInput").addEventListener("keyup", function(event) {
let searchQuery = event.target.value.toLowerCase();
});
Console
/index.html
-3:34