Explore the use of three nodes in the DOM Model

Source: Internet
Author: User

This article briefly introduces the nodes in the DOM model. There are three nodes in the DOM model: Element nodes, attribute nodes, and text nodes, I believe that you have a deep understanding of the DOM model nodes through this article.

Nodes in the DOM Model

There are three nodes in the DOM model: Element Node, attribute node, and text node.

Element Node

It can be said that the entire DOM model is composed of element nodes. Element nodes can contain other elements. For example, <li> can be contained in <ul>. Only the root element HTML is not included.

Attribute node

As an element in a page, there are more or less attributes. For example, almost all elements have the title attribute. Developers can use these attributes to make more accurate descriptions of objects contained in elements. For example:

 
 
  1. <Ahrefahref = http://www.sutao123.cn
  2. Title = "I am the master of my data network"> I am the master of my data network </a>

In the above Code, href = "http://www.sutao123.cn" and title = "my profile I am the master" are two attribute nodes. Because attributes are placed in tags, attribute nodes are always included in element nodes.

Text Node

In HTML, it is not enough to build a framework. The purpose of the page is to display content to users. For example, in the above example, "my data network is my master" is a text node that we want to display to users. This section briefly introduces the DOM model nodes.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.