The Document Object Model (DOM) is the structure of a webpage's code. There are many different ways to build and alter HTML elements with JavaScript (called nodes).
- Node Properties:
- attributes — Gets a live list of all the characteristics associated with an element.
- baseURI — Returns an HTML element's absolute base URL.
- childNodes — Returns a list of the child nodes of an element.
- firstChild — Returns the element's first child node.
- lastChild — An element's final child node.
- nextSibling — Returns the next node in the same node tree level as the current node.
- nodeName — Returns a node's name.
- nodeType — Returns the node's type.
- nodeValue — Sets or returns a node's value.
- ownerDocument — This node's top-level document object.
- parentNode — Returns the element's parent node.
- previousSibling — Gets the node that comes before the current one.
- textContent — Sets or returns a node's and its descendants' textual content.
- Node Methods:
- appendChild() — Adds a new child node as the last child node to an element.
- cloneNode() — Duplicates an HTML element.
- compareDocumentPosition() — Compares two elements' document positions.
- getFeature() — Returns an object that implements the APIs of a feature.
- hasAttributes() — Returns true if an element has any attributes; otherwise false.
- hasChildNodes() — Returns true if an element has any child nodes.
- insertBefore() — Adds a new child node before an existing child node.
- isDefaultNamespace() — Returns true if a given namespaceURI is the default.
- isEqualNode() — Determines whether two elements are the same.
- isSameNode() — Checks if two references point to the same node.
- isSupported() — Returns true if the element supports the provided feature.
- lookupNamespaceURI() — Returns the namespace URI for a specific node.
- lookupPrefix() — Returns the prefix string for a given namespace URI if present.
- normalise() — Joins neighbouring text nodes and removes empty text nodes.
- removeChild() — Removes a child node from an element.
- replaceChild() — Replaces a child node in an element.
- Element Methods:
- getAttribute() — Returns the value of an element node's attribute.
- getAttributeNS() — Returns the string value of an attribute with the namespace and name supplied.
- getAttributeNode() — Returns the attribute node supplied.
- getAttributeNodeNS() — Returns the attribute node for the specified namespace and name.
- getElementsByTagName() — Returns a list of all child elements with the supplied tag name.
- getElementsByTagNameNS() — Returns a live HTMLCollection of items in the provided namespace with a certain tag name.
- hasAttribute() — Returns true if an element has any attributes.
- hasAttributeNS() — Returns true/false depending on whether the element in a namespace has the supplied attribute.
- removeAttribute() — Removes an element's supplied attribute.
- removeAttributeNS() — Removes an attribute from an element in a specific namespace.
- setAttributeNode() — Sets or modifies an attribute node.
- setAttributeNodeNS() — Sets a new namespaced attribute node to an element.






