Finding elements
[Long-distance travel]
Through the getElementById() and getElementsByTagName() methods.
[Short-distance travel]
The five properties are parentNode, firstChild, lastChild, previousSibling, and nextSibling.
Node information
nodeName, nodeValue, nodeType, and tagName.
Changing the document tree
appendChild(), insertBefore(), removeChild() and replaceChild().
Creating and cloning elements
documnet.createElement(), documnet.createTextNode().
cloneNode() expects an argument true or false.
true means "Clone the element and all its child nodes."
false means "Clone the element but not its child nodes."
innerHTML, outerHTML, innerText and outerText
Attributes
getAttribute() and setAttribute().
Level 0 DOM
document.forms[], document.images[], document.links[]
留言列表