목록2024/04/25 (1)
기초공사 (html,css,javascript)
nodelist 와 htmlcollection 차
// 위의 코드를 보면 htmlcollection은 '6'으로 바로 반영이 되는데 --> live 실시간으로 반영nodelist는 한번 찍힌 '5'는 div가 추가 되어도 바뀌지 않는다.(상단에 있었자만) --> nolive--> live와 nolive가 이말 이었음. nodelist를 6으로 바뀌고 하고싶으면 NodeList와 HTMLCollection의 업데이트 방식이다. 1. Live Collection vs Static Collection : - HTMLCollection은 "live" 컬렉션이다. 즉 DOM 변경사항이 실시간으로 반영된다. 따라서 새로운 가 추가되면 그 변경사항이 즉시 HTML..
academy/JavaScript
2024. 4. 25. 17:42