diff --git a/script.js b/script.js index 5762129..4738e33 100644 --- a/script.js +++ b/script.js @@ -1,20 +1,48 @@ console.log("Hello! If you see this, the script is working."); +console.log("Problem 1"); + /* +<<<<<<< HEAD + - [ ] Select the section with an id of container without using querySelector. - [ ] Select the section with an id of container using querySelector. - [ ] Select all of the list items with a class of "second". - [ ] Select a list item with a class of third, but only the list item inside of the ol tag. +/* - [ ] Give the section with an id of container the text "Hello!". - [ ] Add the class main to the div with a class of footer. - [ ] Remove the class main on the div with a class of footer. - [ ] Create a new li element. + + + +Ramses - [ ] Give the li the text "four". - [ ] Append the li to the ul element. - [ ] Loop over all of the lis inside the ol tag and give them a background color of "green". - [ ] Remove the div with a class of footer. */ + // Try rewriting this without using querySelector const header = document.querySelector("#container"); -console.log("header", header); +const container = document.getElementById("container"); + +//Selecting section with id of container using querySelector +console.log("Problem 2"); + +const containerQuery = document.querySelector("#container"); +console.log("containerQuery", containerQuery); + +// Selecting all list items with a class of "second" +console.log("Problem 3"); + +const secondItems = document.getElementsByClassName("second"); +console.log("secondItems", secondItems); + +// Selecting a list item with a class of third, but only the list item inside of the ol tag +console.log("Problem 4"); + + +const thirdOlItem = document.querySelector("ol .third"); diff --git a/temp.js b/temp.js new file mode 100644 index 0000000..4fa83b9 --- /dev/null +++ b/temp.js @@ -0,0 +1,4 @@ +newP = document.createElement('p'); +newP.innerText = "hello"; +containerByID = document.getElementById("container"); +containerByID.appendChild(newP); \ No newline at end of file