DOM Node Methods

This is the table of DOM Node Methods with a short description of each method.

MethodDescription
addEventListener()Adds an event listener to the specified node to run a function on the event sent to it as a parameter.
appendChild()Appends a node as the last child of the specified node.
attachEvent()Attaches an event to the specified node to run a function on the event sent to it as a parameter.
blur()Removes focus from the specified node.
click()Executes the click event on the specified node.
cloneNode()Creates a clone of the specified node.
detachEvent()Detaches an event from the specified node.
dispatchEvent()Executes an event on the specified node.
focus()Gives focus to the specified node.
getAttribute()Returns the value of the attribute name sent to it as a parameter on the specified node.
getAttributeNS()Returns the value of the attribute name and name space sent to it as a parameter on the specified node.
getAttributeNode()Returns the attribute node of the attribute name sent to it as a parameter on the specified node.
getAttributeNodeNS()Returns the attribute node of the attribute name and name space sent to it as a parameter on the specified node.
getElementByTagName()An array of all the child element nodes with the tag name sent to it as parameter in the specified node.
getElementByTagNameNS()An array of all the child element nodes with the tag name and name space sent to it as parameter in the specified node.
hasAttribute()Returns true if the attribute name sent to it exists on the specified node, or false if not.
hasAttributeNS()Returns true if the attribute name and name space sent to it exists on the specified node, or false if not.
hasAttributes()Returns true if the specified node has any attribute nodes defined, or false if not.
hasChildNodes()Returns true if the specified node has any child nodes, or false if not.
insertBefore()Inserts a node sent to it as parameter before the node sent to it as a second parameter inside the specified node.
normalize()Normalizes the specified node.
removeAttribute()Removes the attribute node for the attribute name sent to it as parameter from the specified node.
removeAttributeNode()Removes the attribute node for the attribute node object reference sent to it as parameter from the specified node.
removeAttributeNS()Removes the attribute node for the attribute name sent to it as parameter with the name space sent to it as parameter from the specified node.
removeChild()Removes the child node sent to it as parameter from the specified node.
removeEventListener()Removes an event listener from the specified node.
replaceChild()Replaces the child node sent to it as the second parameter with the child node sent to it as the first parameter in the specified node.
scrollIntoView()Scrolls the specified node into view in the browser window.
setAttribute()Sets an attribute node’s name (first parameter) and value (second parameter) for the specified node.
setAttributeNode()Sets an attribute node as the attribute node object sent to it as parameter for the specified node.
setAttributeNodeNS()Sets an attribute node as the attribute node object sent to it as parameter
with the namespace sent to it as parameter for the specified node.
setAttributeNS()Sets an attribute node’s name space (first parameter), name (second parameter),
and value (third parameter) for the specified node.

Leave a Reply