목록DOM (2)
삶 가운데 남긴 기록 AACII.TISTORY.COM

DOM(Document Object Model) document 변수를 통해 접근하는 HTML Element 트리구조로 부모(parent), 자손(child), 형제(siblings)관계로 이루어지고 최상위 조상은 Document 객체입니다. 이벤트 capturing: 이벤트가 발생한 target 요소의 부모로부터 자손까지 이벤트가 일어났는지 검사해 자손의 이벤트를 통보받을 수 있게 등록한 이벤트 핸들러가 있는 지 확인 하는 과정 이벤트 bubling: element들이 부모자손 관계로 중첩될 때 이벤트가 자손부터 실행되어 부모순으로 이벤트 핸들러를 찾아 수행 하며 상위 element로 이벤트를 전파하는 과정 주요 프로퍼티 document.documentElement //문서 루트 객체 참조 docume..

html은 태그들의 tree 구조로 되어 있는 데 이 것을 DOM tree 라고 부릅니다. 이러한 DOM 트리를 검색하면서 특정 태그(element)를 선택하여 CSS를 적용할 수 있습니다. 이렇게 html 의 요소(element)를 특정하여 선택할 수 있게 해주는 것을 selector (선택자)라고 부릅니다. element selector * 모든 element type 지정한 타입의 element class 지정한 class의 element type.class 지정한 클래스에 속하는 지정한 타입의 element #id attribute에 지정한 id값에 해당하는 element attribute selector [attr] attr 어트리뷰트를 정의하는 element [attr="val"] attr 의..