-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
43 lines (30 loc) · 845 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// #1
let contain = document.getElementById("container")
//#2
let containQuery = document.querySelector("#container")
//#3
let secondSelect = document.querySelectorAll(".second")
//#4
let thirdSelect = document.querySelector("ol > li.third")
//#5
//contain.innerText = "Hello"
//#6
let divSelect = document.querySelector("div.footer");
divSelect.classList.add("main")
//#7
divSelect.classList.remove("main")
//#8
let list = document.createElement("li")
//#9
list.innerText = "four"
//#10
document.querySelector("ul").append(list)
//#12
let ordered = document.querySelectorAll("ol > li")
for (let i = 0; i < ordered.length; i++) {
ordered[i].style.backgroundColor = "green"
}
//Second answer: ordered.forEach(li => li.style.backgroundColor = "green")
//#13
//divSelect.remove()
document.querySelector("div.footer").remove()