getElementsByClassName() : 많은 element를 가져올때 씀(array를 반환)
-getElementsByTagName() : name을 할당할 수 있음(array를 반환)
-querySelector(“div.hello.h1”) : element를 CSS selector방식으로 검색할 수 있다. 첫번째의 element를 return해줌
⇒ hello란 class 내부에 있는 h1을 가지고 올 수 있다(id도 가능함)
-querySelectorAll(“div.hello.h1”) : 모든 element를 가져 온다.
⇒ h1이 들어있는 array를 가져다 줌
'Basic > 노마드코더' 카테고리의 다른 글
노마드코더__바닐라 JS로 크롭웹만들기 수업노트 #1 - 변수와 return. (0) | 2022.03.30 |
---|---|
노마드코더 코코아톡 클론코딩 HTML&CSS 수업리뷰#3- Learning CSS 2 (0) | 2022.03.23 |
노마드코더 코코아톡 클론코딩 HTML&CSS 수업리뷰#3- Learning CSS 1.1 (0) | 2022.03.23 |
노마드코더 코코아톡 클론코딩 HTML&CSS 수업리뷰#2- Learning HTML (0) | 2022.03.15 |
노마드코더 코코아톡 클론코딩 HTML&CSS 수업리뷰#1 - Introduce (0) | 2022.03.07 |
댓글