Document Object Model (DOM)
Checking compatibility...
Programmatically access and modify web page content and structure. The DOM represents HTML documents as a tree of objects that can be manipulated using JavaScript.
DOM API
Access and modify web page content dynamically with JavaScript using the DOM's methods and properties.
The DOM API provides methods and properties for:
- Accessing elements using methods like getElementById, querySelector, and getElementsByTagName
- Creating new elements with createElement and appendChild methods
- Modifying element content through properties like innerHTML, textContent, and innerText
- Handling events with addEventListener and removeEventListener
- Manipulating element attributes and styles through getAttribute, setAttribute, and style properties
- Traversing the document tree using properties like parentNode, childNodes, and siblings
For more detailed examples and usage, check out the HTML DOM API section.