JavaScript DOM Summary

Source: Internet
Author: User

JavaScript DOM Summary

DOM (Document Object Model) is a Document Object Model. APIs for HTML and XML documents (application interfaces ), is a platform that allows programs and scripts to dynamically access and update document content, structure, and style language. D (document) is a webpage document loaded on the web; O (Object), a well-known Object that can call attributes and methods; M (Model) is understood as the structure of the webpage document.

The main content is summarized as follows:

DOM divides the tree structure generated when the web browser loads HTML into nodes:

We have already touched on these items in our previous learning process, and meta is relatively unfamiliar. Its main purpose is to set the encoding method of the webpage language. It usually appears in the webpage title, but is not displayed on the browser page, but only in the source code.

These nodes are generally divided into three types: Element nodes, text nodes, and attribute nodes. For example

For test, div indicates the element node, title = "attribute" indicates the attribute node, and "test" indicates the text node.

 

The DOM type is similar to the Node type. For example, the DOM Node type contains elements, attributes, and text. They exist to obtain the corresponding attribute values in the Node, for example: node. ELEMENT_NODE can be used to obtain the Element Node Type value.

In DOM extension, there is a scrolling method, mainly used for page information too much, you can set the desired position for loading. Can this be applied to evaluation? Everyone knows that in the evaluation system, if one option is not selected, the system will prompt that the option is not selected, but will not jump to the corresponding location. So, can this method achieve the jump? Whether or not it can be implemented remains to be learned in the future.

To reduce the amount of code in the program, DOM can be used to dynamically add CSS styles and scripts to webpages to separate program code from CSS and js, which is easy to expand, it brings great convenience to our program maintenance.

 

 

Summary:

Through this period of study, JavaScript is a real entry point. In the previous learning process, I only learned the basic knowledge and how to apply it. Some operations in the DOM have led you to think of many methods in the cool. You didn't know much about them before. You only know how to implement the functions. But the specific principle is not clear. After learning this part of content, I found some paths and understood why. However, if you want to learn more, you need to learn more...

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.