getElementById(id):해당하는 id의 요소들을 가져와서 이를 나타내는 element객체를 반환하는 dom 메서드
getElementsByTagName(tag):해당하는 태그의 요소들을 가져와서 이를 나타내는 element객체를 반환하는 dom 메서드
getElementsByClassName(class):해당하는 클래스의 요소들을 가져와서 이를 나타내는 element객체를 반환하는 dom 메서드
getElementsByName(name):해당하는 네임의 요소들을 가져와서 이를 나타내는 element객체를 반환하는 dom 메서드
노드 생성
요소 노드 생성 : createElement(tag)
텍스트 노드 생성 : createTextNode(text)
속성 노드 생성 : createAttribute(attr)
주석 노드 생성 : createComment(text)
노드 추가
마지막 자식 노드 추가 :
appendChild()
지정 자식 노드 바로 앞에 추가 :insertBefore(new,reference)
- ParentNode.prepend() : 부모 노드 ParentNode의 처음 자식 노드로 추가
- ParentNode.append() : 부모 노드 ParentNode의 마지막 자식 노드로 추가