First, what is Domdom is an abbreviation for the Document Object model. DOM is the standard of the World Wide Web Consortium. The DOM defines the standard for accessing HTML and XML documents: The Document Object Model (DOM) is a platform-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document. The DOM standard is divided into 3 different parts:
- Core DOM-a standard model for any structured document
- XML DOM-a standard model for XML documents
- HTML DOM-A standard model for HTML documents
HTML DOM (Document Object model) when the page is loaded, the browser creates the Document Object Model (DOM) of the page. Through the HTML DOM, you can access all the elements of a JavaScript HTML document. The HTML DOM defines the objects and properties of all HTML elements, as well as how to access them. Third, DOM nodes according to the HTML DOM standard, all the content in the HTML document is a node:
- The entire document is a document node
- Each HTML element is an element node
- Each HTML attribute is an attribute node
- Text within an HTML element is a text node
- Comment is a comment node
The HTML DOM sees an HTML document as a tree structure. This structure is called the Node tree: The programming interface can access the HTML DOM through JavaScript (and other programming languages). All HTML elements are defined as objects, while programming interfaces are object methods and object properties. Methods are actions that you can perform (such as adding or modifying elements). A property is a value that you can get or set (such as the name or content of a node).
JavaScript (third, DOM document Object model)