DOM
The DOM (Document Object Model) API represents HTML and XML documents as trees of nodes. You can use the API to inspect and modify the structure and content of a document. To learn more, see Attr, Attr: localName property, Attr: name property, Attr: namespaceURI property, Attr: ownerElement property, Attr: prefix property, Attr: value property, CDATASection, CharacterData, CharacterData: after() method, CharacterData: appendData() method, CharacterData: before() method, CharacterData: data property, CharacterData: deleteData() method, CharacterData: insertData() method, CharacterData: length property, CharacterData: nextElementSibling property, CharacterData: previousElementSibling property, CharacterData: remove() method, CharacterData: replaceData() method, CharacterData: replaceWith() method, CharacterData: substringData() method, Comment, Comment: Comment() constructor, DOMException, DOMException: DOMException() constructor, DOMException: message property, DOMException: name property, DOMImplementation, DOMImplementation: createDocument() method, DOMImplementation: createDocumentType() method, DOMImplementation: createHTMLDocument() method, DOMStringList, DOMStringList: contains() method, DOMStringList: item() method, DOMStringList: length property, DOMTokenList, DOMTokenList: add() method, DOMTokenList: contains() method, DOMTokenList: entries() method, DOMTokenList: forEach() method, DOMTokenList: item() method, DOMTokenList: keys() method, DOMTokenList: length property, DOMTokenList: remove() method, DOMTokenList: replace() method, DOMTokenList: supports() method, DOMTokenList: toggle() method, DOMTokenList: value property, DOMTokenList: values() method, Document, Document: DOMContentLoaded event, Document: Document() constructor, Document: URL property, Document: activeElement property, Document: adoptNode() method, Document: append() method, Document: body property, Document: characterSet property, Document: childElementCount property, Document: children property, Document: close() method, Document: compatMode property, Document: contentType property, Document: createAttribute() method, Document: createAttributeNS() method, Document: createCDATASection() method, Document: createComment() method, Document: createDocumentFragment() method, Document: createElement() method, Document: createElementNS() method, Document: createNodeIterator() method, Document: createProcessingInstruction() method, Document: createTextNode() method, Document: createTreeWalker() method, Document: currentScript property, Document: defaultView property, Document: dir property, Document: doctype property, Document: documentElement property, Document: documentURI property, Document: embeds property, Document: firstElementChild property, Document: forms property, Document: getElementById() method, Document: getElementsByClassName() method, Document: getElementsByName() method, Document: getElementsByTagName() method, Document: getElementsByTagNameNS() method, Document: hasFocus() method, Document: head property, Document: images property, Document: implementation property, Document: importNode() method, Document: lastElementChild property, Document: lastModified property, Document: links property, Document: open() method, Document: plugins property, Document: prepend() method, Document: querySelector() method, Document: querySelectorAll() method, Document: readyState property, Document: readystatechange event, Document: referrer property, Document: replaceChildren() method, Document: scripts property, Document: title property, DocumentFragment, DocumentFragment: DocumentFragment() constructor, DocumentFragment: append() method, DocumentFragment: childElementCount property, DocumentFragment: children property, DocumentFragment: firstElementChild property, DocumentFragment: getElementById() method, DocumentFragment: lastElementChild property, DocumentFragment: prepend() method, DocumentFragment: querySelector() method, DocumentFragment: querySelectorAll() method, DocumentFragment: replaceChildren() method, DocumentType, DocumentType: after() method, DocumentType: before() method, DocumentType: name property, DocumentType: publicId property, DocumentType: remove() method, DocumentType: replaceWith() method, DocumentType: systemId property, Element, Element: after() method, Element: append() method, Element: attributes property, Element: before() method, Element: childElementCount property, Element: children property, Element: classList property, Element: className property, Element: closest() method, Element: firstElementChild property, Element: getAttribute() method, Element: getAttributeNS() method, Element: getAttributeNames() method, Element: getAttributeNode() method, Element: getAttributeNodeNS() method, Element: getElementsByClassName() method, Element: getElementsByTagName() method, Element: getElementsByTagNameNS() method, Element: hasAttribute() method, Element: hasAttributeNS() method, Element: hasAttributes() method, Element: id property, Element: innerHTML property, Element: insertAdjacentElement() method, Element: insertAdjacentHTML() method, Element: insertAdjacentText() method, Element: lastElementChild property, Element: localName property, Element: matches() method, Element: namespaceURI property, Element: nextElementSibling property, Element: outerHTML property, Element: prefix property, Element: prepend() method, Element: previousElementSibling property, Element: querySelector() method, Element: querySelectorAll() method, Element: remove() method, Element: removeAttribute() method, Element: removeAttributeNS() method, Element: removeAttributeNode() method, Element: replaceChildren() method, Element: replaceWith() method, Element: setAttribute() method, Element: setAttributeNS() method, Element: setAttributeNode() method, Element: setAttributeNodeNS() method, Element: tagName property, Element: toggleAttribute() method, HTMLCollection, HTMLCollection: item() method, HTMLCollection: length property, HTMLCollection: namedItem() method, HTMLDocument, The HTML DOM API, HTMLElement: dir property, HTMLElement: hidden property, HTMLElement: innerText property, HTMLElement: outerText property, NamedNodeMap, NamedNodeMap: getNamedItem() method, NamedNodeMap: getNamedItemNS() method, NamedNodeMap: item() method, NamedNodeMap: length property, NamedNodeMap: removeNamedItem() method, NamedNodeMap: removeNamedItemNS() method, NamedNodeMap: setNamedItem() method, NamedNodeMap: setNamedItemNS() method, Node, Node: appendChild() method, Node: baseURI property, Node: childNodes property, Node: cloneNode() method, Node: compareDocumentPosition() method, Node: contains() method, Node: firstChild property, Node: hasChildNodes() method, Node: insertBefore() method, Node: isDefaultNamespace() method, Node: isEqualNode() method, Node: isSameNode() method, Node: lastChild property, Node: lookupNamespaceURI() method, Node: lookupPrefix() method, Node: nextSibling property, Node: nodeName property, Node: nodeType property, Node: nodeValue property, Node: normalize() method, Node: ownerDocument property, Node: parentElement property, Node: parentNode property, Node: previousSibling property, Node: removeChild() method, Node: replaceChild() method, Node: textContent property, NodeIterator, NodeIterator: filter property, NodeIterator: nextNode() method, NodeIterator: pointerBeforeReferenceNode property, NodeIterator: previousNode() method, NodeIterator: referenceNode property, NodeIterator: root property, NodeIterator: whatToShow property, NodeList, NodeList: entries() method, NodeList: forEach() method, NodeList: item() method, NodeList: keys() method, NodeList: length property, NodeList: values() method, ProcessingInstruction, ProcessingInstruction: target property, Text, Text: Text() constructor, Text: splitText() method, Text: wholeText property, TreeWalker, TreeWalker: currentNode property, TreeWalker: filter property, TreeWalker: firstChild() method, TreeWalker: lastChild() method, TreeWalker: nextNode() method, TreeWalker: nextSibling() method, TreeWalker: parentNode() method, TreeWalker: previousNode() method, TreeWalker: previousSibling() method, TreeWalker: root property, TreeWalker: whatToShow property, XMLDocument at MDN.
Compatibility
- Chrome 1 Released on 2008-12-11
- Chrome Android 18 Released on 2012-06-27
- Edge 12 Released on 2015-07-29
- Firefox 1 Released on 2004-11-09
- Firefox for Android 4 Released on 2011-03-29
- Safari 1 Released on 2003-06-23
- Safari on iOS 1 Released on 2007-06-29
Specifications
- DOM Standard, from DOM Workstream (WHATWG).