DOM Element

Element Object

Property / Method Description
elem.accessKeySets or returns the accesskey attribute of an element
elem.addEventListener()Attaches an event handler to the specified element
elem.appendChild()Adds a new child node, to an element, as the last child node
elem.attributesReturns a NamedNodeMap of an element's attributes
elem.blur()Removes focus from an element
elem.childElementCountReturns the number of child elements an element has
elem.childNodesReturns a collection of an element's child nodes (including text and comment nodes)
elem.childrenReturns a collection of an element's child element (excluding text and comment nodes)
elem.classListReturns the class name(s) of an element
elem.classNameSets or returns the value of the class attribute of an element
elem.click()Simulates a mouse-click on an element
elem.clientHeightReturns the height of an element, including padding
elem.clientLeftReturns the width of the left border of an element
elem.clientTopReturns the width of the top border of an element
elem.clientWidthReturns the width of an element, including padding
elem.cloneNode()Clones an element
elem.compareDocumentPosition()Compares the document position of two elements
elem.contains()Returns true if a node is a descendant of a node, othwerwise false
elem.contentEditableSets or returns whether the content of an element is editable or not
elem.dirSets or returns the value of the dir attribute of an element
elem.firstChildReturns the first child node of an element
elem.firstElementChildReturns the first child element of an element
elem.focus()Gives focus to an element
elem.getAttribute()Returns the specified attribute value of an element node
elem.getAttributeNode()Returns the specified attribute node
elem.getElementsByClassName()Returns a collection of all child elements with the specified class name
elem.getElementsByTagName()Returns a collection of all child elements with the specified tag name
elem.getFeature()Returns an object which implements the APIs of a specified feature
elem.hasAttribute()Returns true if an element has the specified attribute, otherwise false
elem.hasAttributes()Returns true if an element has any attributes, otherwise false
elem.hasChildNodes()Returns true if an element has any child nodes, otherwise false
elem.idSets or returns the value of the id attribute of an element
elem.innerHTMLSets or returns the content of an element
elem.insertBefore()Inserts a new child node before a specified, existing, child node
elem.isContentEditableReturns true if the content of an element is editable, otherwise false
elem.isDefaultNamespace()Returns true if a specified namespaceURI is the default, otherwise false
elem.isEqualNode()Checks if two elements are equal
elem.isSameNode()Checks if two elements are the same node
elem.isSupported()Returns true if a specified feature is supported on the element
elem.langSets or returns the value of the lang attribute of an element
elem.lastChildReturns the last child node of an element
elem.lastElementChildReturns the last child element of an element
elem.namespaceURIReturns the namespace URI of an element
elem.nextSiblingReturns the next node at the same node tree level
elem.nextElementSiblingReturns the next element at the same node tree level
elem.nodeNameReturns the name of a node
elem.nodeTypeReturns the node type of a node
elem.nodeValueSets or returns the value of a node
elem.normalize()Joins adjacent text nodes and removes empty text nodes in an element
elem.offsetHeightReturns the height of an element, including padding, border and scrollbar
elem.offsetWidthReturns the width of an element, including padding, border and scrollbar
elem.offsetLeftReturns the horizontal offset position of an element
elem.offsetParentReturns the offset container of an element
elem.offsetTopReturns the vertical offset position of an element
elem.ownerDocumentReturns the root element (document object) for an element
elem.parentNodeReturns the parent node of an element
elem.parentElementReturns the parent element node of an element
elem.previousSiblingReturns the previous node at the same node tree level
elem.previousElementSiblingReturns the previous element at the same node tree level
elem.querySelector()Returns the first child element that matches a specified CSS selector(s) of an element
elem.querySelectorAll()Returns all child elements that matches a specified CSS selector(s) of an element
elem.removeAttribute()Removes a specified attribute from an element
elem.removeAttributeNode()Removes a specified attribute node, and returns the removed node
elem.removeChild()Removes a child node from an element
elem.replaceChild()Replaces a child node in an element
elem.removeEventListener()Removes an event handler that has been attached with the addEventListener() method
elem.scrollHeightReturns the entire height of an element, including padding
elem.scrollLeftSets or returns the number of pixels an element's content is scrolled horizontally
elem.scrollTopSets or returns the number of pixels an element's content is scrolled vertically
elem.scrollWidthReturns the entire width of an element, including padding
elem.setAttribute()Sets or changes the specified attribute, to the specified value
elem.setAttributeNode()Sets or changes the specified attribute node
elem.styleSets or returns the value of the style attribute of an element
elem.tabIndexSets or returns the value of the tabindex attribute of an element
elem.tagNameReturns the tag name of an element
elem.textContentSets or returns the textual content of a node and its descendants
elem.titleSets or returns the value of the title attribute of an element
elem.toString()Converts an element to a string
  

NodeList Properties and Methods

nodelist.item()Returns the node at the specified index in a NodeList
nodelist.lengthReturns the number of nodes in a NodeList
  
Property / Method Description