티스토리 뷰
728x90
반응형
getElementById, getElementsByClassName 등 사용하면 리턴되는값은 Collection 객체이다
ex) let test = document.getElementById('test');
console.log( test.children ); <- 호출시 undefind
console.log( test[0].children ); <- collection이기때문에 인덱스로 접근하여 사용
728x90
반응형
'Error > JavaScript' 카테고리의 다른 글
[JavaScript] Mac OS에서 파일 첨부 시 한글 파일명 깨지는 문제 수정 (0) | 2021.07.27 |
---|---|
[JavaScript] 화살표함수의 this (0) | 2021.07.02 |
[JavaScript] Chrome xmlhttprequest.onprogress e.total이 0일때 (0) | 2021.02.18 |
[JavaScript] JSON.parse() Uncaught SyntaxError: Unexpected token (0) | 2020.04.02 |
[JavaScript] undefined 체크하는법 (0) | 2019.06.12 |
댓글