HTMLCollection, NodeList
·
👩🏻‍💻STUDY/JavaScript
HTMLCollection과 NodeList가 도대체 뭔지..이번에도 gpt를 사용해서 정리해본다. 1. HTMLCollection과 NodeList 공통점DOM 요소의 집합배열처럼 인덱스로 요소 접근 가능`length` 프로퍼티로 요소의 개수 확인 가능2. HTMLCollection과 NodeList 차이점구분HTMLCollectionNodeList생성 메서드`getElementsByClassName()``getElementsByTagName()``document.forms``form.elements``document.image``document.links``document.anchors``querySelectAll()``childNodes`Live 여부O (DOM 변경 시 자동 업데이트)X 대부분 S..