DOM node interface properties and methods.
Lists the set of properties and methods contained in the node types.
Back to JavaScript: DOM
DOM properties:
nodeName |
Returns a string of the name of the node depending on the type of node. |
nodeValue |
Returns a string of the value of the node depending on the type of node. |
nodeType |
Returns a number: a node type constant value. |
ownerDocument |
Returns the document that the node belongs to. |
childNodes |
Returns an array value list of the child nodes of a node. Access using array notation: childNodes[n]. |
firstChild |
Returns the first node in the childNodes value list: childNodes[0]. |
lastChild |
Returns the last node in the childNodes value list. |
previousSibling |
Returns the previous sibling, null if node is the first sibling. |
nextSibling |
Returns the next sibling, null if node is the last sibling. |
parentNode |
Returns the parent of a node. |
DOM methods:
hasChildNodes() |
Returns boolean: true if childNodes has one or more nodes. |
appendChild(node) |
Adds 'node' to the end of childNodes. |
removeChild(node) |
Removes 'node' from childNodes. |
replaceChild(newNode, oldNode) |
Replaces 'oldNode' with 'newNode' in childNodes. |
insertBefore(newNode, node) |
Inserts 'newNode' before 'node' in childNodes. |
createTextNode(text) |
Creates a text node containing 'text'. |
createElement(tagName) |
Creates an element 'tagName'. |
Back to top.
Copyright © 2006-2012 justfigures.co.uk
