HTML DOM node operations (GET/modify/Add or delete) _javascript tips
Source: Internet
Author: User
The HTML DOM is the standard for how to get, modify, add, or delete HTML elements. In the HTML DOM, all things are nodes. The DOM is the HTML that is treated as a node tree.
All content in an HTML document is a node, based on the HTML DOM standard of the consortium:
The entire document is a document node
Each HTML element is an element node
Text within an HTML element is a text node
Each HTML attribute is an attribute node
Comments are annotation nodes
The HTML DOM sees an HTML document as a tree structure. This structure is called the node tree:
HTML DOM Tree Instance
Yun_qi_img/ct_htmltree.gif
Through the HTML DOM, all nodes in the tree are accessible through JavaScript. All HTML elements (nodes) can be modified, or nodes can be created or deleted.
All HTML elements are defined as objects, while programming interfaces are object methods and object properties.
Two: After getting to the element node we can do the operation to him: 1. The operation of oneself. 2. Operation of child nodes. 3. The operation of the sibling node. 4. Actions on the parent node
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.