document.createElement()
Creates an Element nodedocument.createTextNode()
Creates a Text nodeelement.appendChild("new node")
Adds a new child node, to an element, as the last child nodeelement.insertBefore("new node", "Which node before")
Inserts a new child node before a specified, existing, child nodeelement.removeChild("existing node")
Removes a child node from an elementelement.replaceChild("new node", "Which existing node will be replace")
Replaces a child node in an elementto learn more: http://www.w3schools.com/jsref/dom_obj_document.asp
Dom Traversing
================================================
element.parentNode
Returns the parent node of an elementelement.parentElement
Returns the parent element node of an elementelement.childNodes
Returns a collection of an elements child nodes (including text and comment nodes)element.childNodes[i]
Returns an element child nodes (including text and comment nodes)element.firstChild
Returns the first child node of an elementelement.firstElementChild
Returns the first child element of an elementelement.lastChild
Returns the last child node of an elementelement.lastElementChild
Returns the last child element of an elementelement.nextSibling
Returns the next node at the same node tree levelelement.nextElementSibling
Returns the next element at the same node tree levelelement.previousSibling
Returns the previous node at the same node tree levelelement.previousElementSibling
Returns the previous element at the same node tree levelto learn more: http://www.w3schools.com/jsref/dom_obj_all.asp
No comments:
Post a Comment