-
Notifications
You must be signed in to change notification settings - Fork 0
/
6일차.txt
37 lines (24 loc) · 899 Bytes
/
6일차.txt
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
23/07/15 6일차 퀴즈
Nomadcoder JS Challenge
From JS we can get elements from the HTML.
-> Yes.
What object do we use to access HTML from JS?
-> document
How can I find the #title with JS?
-> document.getElementById("title")
How can I find all the .button with JS?
-> document.getElementsByClassName("button")
How can I find all the <a> ?
-> document.getElementsByTagName("a")
How can I find all the .home h1:first-child?
-> document.querySelectorAll(".home h1:first-child")
How can I find the first .home h1:first-child?
-> document.querySelector(".home h1:first-child")
We can change the CSS of an element from JS.
-> Yes.
document and window are the same.
-> No.
What is the difference between using className and classList
-> className replaces all classes, classList doesn't
What does classList.toggle do?
-> It adds a class if it does not exist and removes a class that exists.