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[]

 

文章標籤
全站熱搜
創作者介紹
創作者 coolouis 的頭像
coolouis

村天來了

coolouis 發表在 痞客邦 留言(0) 人氣(19)