What is the use of the three nodes in DOM model
Today, I will talk to you about the use of the three nodes in the DOM model, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
To give you a brief introduction to the nodes in the DOM model, there are three kinds of nodes in the DOM model, which are element nodes, attribute nodes and text nodes.
Nodes in DOM Model
There are three kinds of nodes in the DOM model: element node, attribute node and text node.
Element node
It can be said that the whole DOM model is made up of element nodes. Element nodes can contain other elements, for example, they can be included in, and the only thing that is not included is the root element HTML.
Attribute node
As elements on a page, there are more or less attributes. For example, almost all elements have title attributes. Developers can use these attributes to describe the objects contained in the element more accurately. For example:
I am in charge of my data network.
In the above code, href= "http://www.sutao123.cn"" and "title=" are two attribute nodes respectively. Because attributes are placed in tags, attribute nodes are always included in element nodes.
Text node
In HTML, it is not enough to build frames. The ultimate goal of a page is to present content to users. For example, in the above example, "I am in charge of my data network" this is a text node that we want to show to the user.
After reading the above, do you have any further understanding of the use of the three nodes in the DOM model? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.