Dom Summary of JavaScript

Source: Internet
Author: User

The DOM (Document Object model), a documentation-based, API (Application interface) for HTML and XML documents, is a platform that allows programs and scripts to dynamically access and update document content, structure, and style language. D (document), which is a Web-loaded Web page document, O (object), an object that we know well, can invoke properties and methods, and M (Model) is the structure of a Web document.

The main contents are summarized as follows:

The DOM creates a tree structure that the Web browser loads into HTML and divides it into nodes:

Of these we have been in the previous learning process has been exposed, and meta relatively unfamiliar, its main purpose is to set the language of the Web page encoding method. Usually appears in the title section of the page, but is not displayed in the browser page, only appears in the source code.

These nodes are generally divided into three categories: element nodes, text nodes, and attribute nodes. For example <div title= "Properties" > Test </div>,div represent ELEMENT nodes, title= "Properties" are attribute nodes, "Test" is a text node.

There are many similarities between the DOM type and the node type, such as the presence of elements, attributes, and text in the DOM's node type, where they exist in order to get the corresponding attribute values in the node, such as: Node.element_node can get the element node type value.

In the DOM extension, there is a scrolling method, which is used primarily when the page information is too large to set the desired location to load. So can this be applied to the evaluation of teaching? We all know that in the evaluation system, if there is an option is not selected, you will be prompted to have the option is not selected, but will not jump to the corresponding location. So, does this approach make the jump possible? Whether the concrete can be achieved, to continue to learn in the future.

In order to reduce the amount of code in the program, the use of DOM can dynamically add CSS style, script, etc., to achieve the separation of program code and CSS, JS and so on, easy to expand, for our program maintenance brings great convenience.

Summary:

Through this period of study, JS is really a primer. In the previous learning process, only to understand the basics, how to apply the specific now just beginning. Some of the operations in the DOM, let yourself think of the beef brisket in a lot of ways, before are not very understanding, just know to realize the function, the specific principle is not clear. After learning this part of the content, only to touch some doorway, know why. But to get a deeper understanding, you need to learn more ...

Dom Summary of JavaScript

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.