DOM DOM Document Object Model HTML document node
자바스크립트 DOM ㅇ DOM (Document Object Model) : HTML 문서를 구성하고 있는 태그 조작 ㅇ 노드(객체) 접근 문법 설명 document. node 접근 document. node. child. Nodes 모든 자식요소 찾기 document. node. children 모든 자식요소 찾기(요소 노드만) document. node. first. Child 첫번째 자식노드 찾기 document. node. last. Child 마지막 자식노드 찾기 document. node. next. Sibling 다음 형제노드 찾기 document. node. previous. Sibling 이전 형제노드 찾기 document. node. parent. Node 부모노드 찾기
자바스크립트 DOM <body> <ul> <li id="first. Id">A</li> <li name="li. Name">B</li> <li class="li. Class">C</li> </ul> <input type="text" name="text. Name" id="txt. Id" class="text. Class" value="텍스트" /> </body>
자바스크립트 DOM ㅇ FORM 객체 하위요소 접근 (name 또는 id로 직접 접근 가능) <form name="exam. Form"> <input type="text" name="txt 1" value="실행1" /> <input type="text" name="txt 1" value="실행2" /> <input type="text" id="txt 2" value="실행3" /> <input type="text" id="txt 3" value="실행4" /> </form>
- Slides: 6