From a7bb7eac44f43253d9f2ff19984dd90a8a53db58 Mon Sep 17 00:00:00 2001 From: Guarotav Date: Wed, 18 Jun 2025 12:23:29 -0400 Subject: [PATCH] Tasks 1-3 --- script.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/script.js b/script.js index 5762129..7d5fb9f 100644 --- a/script.js +++ b/script.js @@ -15,6 +15,30 @@ console.log("Hello! If you see this, the script is working."); - [ ] Remove the div with a class of footer. */ +// 1) Select the section with an id of container without using querySelector. +let selectContainer = document.getElementById("container"); + +console.log(selectContainer); + +// 2) Select the section with an id of container using querySelector. +let querySelectContainer = document.querySelector("#container"); + +console.log(querySelectContainer); + +// 3) Select all of the list items with a class of "second". +let seconds = document.querySelectorAll(".second"); + +seconds.forEach((item, index) => { + console.log(`.second item ${index + 1}:`, item); +}); + + + + + + + + // Try rewriting this without using querySelector const header = document.querySelector("#container"); console.log("header", header);