classfication
- element node
- attribute node
- text node
find
-
find parent node
<DOM>.parentNode -
find child node
-
single
<DOM>.childNodesget all child node include text node
-
children
<DOM>.childrenonly get element node,return pseudo array
-
-
find brother node
-
next node
<DOM>.nextElementSibling -
previous node
previousElementSibling
-
create node
-
create
document.createElement('<tag>') -
add
-
append
next
<fater Element>.appendChild(<create Element>) -
insert
before
<fater Element>.insertBefore(<create Element>,<insert Element>)
-
clone
<Element>.cloneNode(<bool>)
CloneNode will clone the same elements as the original label
- if true,it will clone descendant nodes
- default is false
delet
<father Element>.removeChild(<delete Element>)
if there is no parent element,it cannot be deleted