Html dom (study Note 1) and htmldom Study Notes

Source: Internet
Author: User

Html dom (study Note 1) and htmldom Study Notes

Well, I have been working for a while, and I have a deep understanding of programming. I used to think that HTML, CSS, and JAVASCRIPT are relatively simple. I can simply read online tutorials, w3C is a website that I often go to learn this knowledge. I am very grateful to her for letting me learn more about the front-end, but now I don't read it like this, front-end engineers mainly work through this (of course, the question must be more extensive and deeper, architecture issues, compatibility issues, performance issues, various plug-ins, JS libraries, front-end tools, and so on, I am also very interested and think it is more professional! At least it makes me feel more fun to modify bugs, modify data for customers, write documents, test, release, and switch back and forth between several projects every day! I used to write a blog to write something that has never been written by others, that I personally experienced, and that has some value for others and myself! Now I feel that my learning experience should be recorded. After all, even if simple knowledge is used less often, it will gradually become blurred with the passage of time, record it, and even sort it out based on your own understanding, you can deepen your understanding of the knowledge! I am not a genius. I don't have a formula in my head, no code, or a special way to understand the world. Then I choose to step by step!


1: What is html dom?

Let's take a look at the structure of a simple HTML document.

<! DOCTYPE html> 

If we rotate the entire document 90 degrees clockwise, we will see the following:

The full name of html dom is:HYperTExtMArkupLAnguage Document Object Model is a Document Object Model of hypertext markup language. My understanding is to look at HTML documents in a different way. It is regarded as an inverted DOM tree. Operations on HTML documents can be seen as operations on the DOM tree, everything in the HTML document is mapped to this DOM tree!

The W3C interpretation is: DOM is W3C standard, and DOM defines the standard for accessing HTML and XML documents (W3C DOM is a platform-neutral and language-neutral interface, it allows programs and scripts to dynamically access and update the content, structure, and style of a document .) W3C standards are divided into three different parts:

1) Core DOM-Standard Model for any structured document

2) xml dom-Standard Model for XML documents

3) html dom-HTML document model

Here we only care about html dom. The official description is as follows:

1) standard HTML Object Model

2) standard HTML programming interface

3) W3C standards

Html dom defines the objects and attributes of all HTML elements and their access methods. To put it simply, html dom is a standard for getting, modifying, adding, or deleting HTML elements. That is to say, another way to operate HTML documents is to add JAVASCRIPT to the script language and perform operations on HTML documents!


2: What is the role of html dom?

Well, the most important thing is to enhance the dynamic interaction of the website, because you can use JAVASCRIPT or server scripts to control HTML documents!

3: What are the key points of html dom content?

In my opinion, after changing an HTML document to a DOM tree, you can modify, add, delete, or change the structure or style of a node, the first step is always to first obtain a node, which is as important as adding, deleting, modifying, and querying data in the database! Therefore, we need to carefully learn the methods and attributes of queries!

4: What is the basic content of html dom?

Before learning html dom, you need to understand HTML, CSS, and JAVASCRIPT. Just like the expression, only the combination of the four can show more flexible and colorful pages!


Of course, to use the DOM tree to Express HTML documents, you must also have a set of control methods. We need to fully convert the perspective. We need to learn some methods to get the nodes in the DOM tree, modify the nodes, add the nodes, delete the nodes, and change the node style and structure, you need to learn about various types of nodes and node attributes, and associate them with HTML, we need to know what label a node is, its attributes, its events, its connection with other nodes, and so on, the methods, methods, attributes, events, and other html dom that you can think of are more rational and control of the DOM tree. These are what we need to learn!

Well, the goal of this article is to give me a clear understanding of html dom, so that I can know what she is, how it is used, and what content it has, then I will slowly add the content to it! Thank you W3C!

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: 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.