Objective
The function of Dom is to turn a Web page into a JavaScript object, so that you can use JavaScript to do a variety of things (such as add and delete content). The browser parses the HTML document into a series of nodes based on the DOM
three ways to use JS1. Directly in the HTML tag, using the event properties, invoke the JS code: Point me! 2. From anywhere on the page, use the script tag3. External: Use the script tag src attribute to select an external address, type attribute
0x01The DOM is the interface of the JavaScript Operation Web page, all called the Document Object model. Its role is to convert the Web page into a JavaScript object, so that you can use JavaScript to do various things (such as adding and deleting
Core of DOM: NodeBecause Dom is a tree structure, a node is abstracted as an object node, which is the core object of DOM:There are 12 types of nodes, which are determined by the value of node. nodetype (1-12: JS
Code
Node. element_node (1)
JS DOM node:The relationship of a node in the JS DOM is defined as the attribute of the node:There are usually the following types of relationships between nodes:(The relationship here is supported by all browsers)
ParentNode parent Node
0x01: Previous WordsThe DOM can depict any HTML as a structure composed of multiple nodes. The nodes are divided into 12 different types, each representing different information and tags in the document. Each node has its own characteristics, data,
The Document Object Model (DOM) is one of the most common tools used to manipulate xml and HTML data. However, its potential is rarely fully explored. Document Object Model (DOM) is one of the most common tools used to manipulate xml and HTML data.
Labels: windows must be organized to be compatible with multiple LAN win wiki padding
This is two different concepts in the browser runtime.
1. Bom browser Object Model
Provides objects that interact with browser windows independently of the content.
The file object model (DOM) is an application interface (API) that represents the various elements of a document (such as HTML and XML) and accesses and operations ). Generally, all browsers that support Javascript support DOM. The DOM involved in
There are three types of nodes: element node, attribute node and text node.
The main point of Dom is to check the additions and deletions around element nodes and attribute nodes . The following are described separately from the operation of
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.