Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ console.log("Hello! If you see this, the script is working.");
- [ ] Remove the div with a class of footer.
*/


// Try rewriting this without using querySelector
const header = document.querySelector("#container");
console.log("header", header);
const header = document.getElementById("container");
console.log("# 1 header", header);


// Using querySelector
const headerQuery = document.querySelector("#container");
console.log("# 2 headerQuery", headerQuery);
// select all using class name
const secondClassItems = document.getElementsByClassName("second");
console.log("# 3 secondClassItems", secondClassItems);
//select all using with third class/inside ol tag
const thirdClassItems = document.querySelector("ol .third");
console.log("# 4 thirdClassItems", thirdClassItems);