Node는 HTML DOM에서 정보를 저장하는 계층적 단위이다.
노드의 종류
- document node(문서 노드)
- element node(요소 노드) - 유일하게 속성 노드를 가질 수 있음.
- comment node(주석 노드)
- attribute node(속성 노드)
- text node(텍스트 노드)
노드의 값
=> nodeName, nodeValue, nodeType등을 통해 접근 가능함.document.childNodes[index] : 문서의 index번째 자식 노드 var node1 = document.childNodes[index] node1.childNodes[index] : node1의 index번째 자식 노드 var node2 = node1.childNodes[index] document.childNodes[0].nodeName : 문서의 첫번째 자식 노드의 이름 document.getElementById("heading").firstChild.nodeValue; : Id가 "heading"인 요소의 첫번째 자식 노드의 값
이후에 추가로 알게된 사실을 계속해서 업로드 할것