HTMLCollection
ElementCollection
NodeCollection
๋ฆฌ์คํธ๋ก ๋์ด ์์
//์๋ฆฌ๋จผํธ๋ฅผ ์ธ๋ฑ์ค๋ก ๊ตฌํ ์ ์์
const el = document.getElementsByClassName("category");
const index = el.item(1); //ํด๋์ค๋ก ์ถ์ถํ ์๋ฆฌ๋จผํธ ์ค์์ [1]์ ์๋ ์๋ฆฌ๋จผํธ๋ฅผ ๋ฐํ
//์๋ฆฌ๋จผํธ๋ฅผ ๋ค์์์ฑ์ผ๋ก ๊ตฌํ ์ ์์
const el = document.getElementsByClassName("category");
const find = el.namedId("fiction"); //fiction์ธ id, name, class ๋ฑ์ ์์ฑ ๊ฐ๊ณผ ์ผ์นํ๋ ์ฒซ๋ฒ์งธ ์๋ฆฌ๋จผํธ ๋ฐํ
for in ์ธ์ง for of ์ธ์ง ๊ตฌ๋ถํด์ผํจ
ArrayLike ์ฌ์ ๋ค๋ฅผ ์ ์๋ฐ
Last updated