Searching For Elements
-getElementsByClassName()
많은 element를 가져올 때 쓴다. (array를 반환!)
-getElementsByTagName()
name을 할당할 수 있다. (array를 반환!)
-querySelector
element를 CSS selector 방식으로 검색할 수 있다.
단 하나의 element를 return해준다.
// class="hello" 를 가진 태그의 하위 태그인 hi 선택
const title = document.querySelector(".hello hi");
-querySelectorAll
조건에 맞는 element들을 모두 가져오고 싶을 때.