- check
- View element node
- document on behalf of the entire document
- document.getElementById () id element in the browser IE8, id not case sensitive, but also returns the name attribute matching elements
- .getElementsByTagName () // tag name
- .getElementsByName () // It should be noted that only part of the tag name may take effect (forms, form elements, img, iframe)
- .getElementsByClassName () // class name -> ie8 and below ie8 ie version does not, can together multiple class
- .querySelector () // css selector is not in ie7 ie7 and in the following versions
- .querySelectorAll () // css selector is not in ie7 ie7 and in the following versions
- Traverse the node tree
- parentNode -> parent node (for the topmost parentNode #document)
- childNodes -> child nodes are
- firstChild -> the first child
- lastChild -> the last child
- nextSiling -> after a sibling
- previousSiling -> previous sibling node
- Based traversing element node of the tree
- parentElement -> Returns the parent element of the current node element (IE incompatible)
- children -> only returns element children of the current element
- View element node
The basic operation of the DOM
Guess you like
Origin www.cnblogs.com/zhuzhu520/p/11929100.html
Ranking