-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (26 loc) · 1.16 KB
/
index.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
document.getElementById("lion").style.color = "red";
document.getElementById("tiger").innerHTML = "blue";
document.getElementById("bear").style.color = "green";
const animals = document.getElementById("animals");
animals.innerHTML += "<li class='animal'>Cat</li>";
document.querySelectorAll(".box")[0].classList.add("purple");
document.querySelectorAll(".box")[0].classList.remove("purple");
document.querySelectorAll(".box")[0].classList.toggle("yellow");
document.querySelectorAll(".box")[0].classList.toggle("yellow");
document.getElementById("btn").addEventListener("click", function(){
console.log("click!!");
});
var num = 0;
document.getElementById("add").addEventListener("click", function(){
num++;
document.getElementById("num").innerHTML = num;
});
document.getElementById("sub").addEventListener("click", function(){
num--;
document.getElementById("num").innerHTML = num;
});
document.querySelector(".bar").addEventListener("click", function(){
// document.querySelector(".bar").innerHTML = "눌렀어!"
// document.querySelector(".newBar").style.display = "block";
document.querySelector(".newBar").classList.toggle("show");
});