Dom is a structured object model that provides a common access method for tag objects. html files are considered as a node tree. Each label and text is a node and can access each node and node content.
In this way, you can access HTML content through the methods and interfaces provided by Dom, without the need to query individual elements one by one.
Advantages:
Cross-platform and program language program Interfaces
Dom provides a standard program processing interface for the application environment, which is a standard API for HTML and XML files and can exchange data over the network.
Supports multiple file formats
Supports multiple programming languages
Dom provides several attributes to easily access nodes in the tree structure. As follows:
Take parentnode, childnodes, and previussibling as examples.
<HTML xmlns = "http://www.w3.org/1999/xhtml">
Click the three radio buttons to obtain the following results:
Obtain the parent, child, and sibling tags of the current tag, you can use these simple methods to add, delete, modify, and query elements in the DOM document model and operate Dom documents.
To be continued ......