Javacript Advanced Programming-dom2 and DOM3

Source: Internet
Author: User

1. DOM2 and DOM3

The DOM2 level specification defines modules that are used to enhance the DOM1 level. "DOM2-Level core" introduces some XML namespace-related methods for different DOM types, which are only used in XML or XHTML and have no practical meaning for HTML documents. In addition to the methods associated with XML namespaces, the DOM2 core defines methods for creating document instances programmatically, and also supports the creation of DocumentType objects.

The "DOM2-level style" module is primarily developed for the style information of the operating element, and its brief features are summarized as follows:

L Each element has an associated style style that can be used to determine and modify the style within the row

To determine the calculated style of an element (including all CSS rules applied to him), you can use the getComputedStyle () method

L IE does not support the getComputedStyle () method, but provides all elements with the ability to return the same information Currentstyle properties

L can access the style sheet through the Document.stylesheet collection

All browsers except IE support the interface to the style sheet, IE also provides its own set of properties and methods for almost all corresponding DOM functions.

The DOM2 level traversal and scope module provides different ways to interact with the DOM structure, briefly summarizing the following:

L traversal uses nodeiterator or treewalker to perform a depth-first traversal of the DOM

L Nodeiterator is a simple interface that allows only one node's stride to move forward and backward, while Treewalker provides the same colleague and supports movement in all directions of the DOM structure, including the parent, sibling, and child nodes.

The L range is the selection of specific parts of the DOM structure, and then the means to perform the appropriate actions

L Use range Select selection to keep the document structure in good form while deleting portions of the document, or to copy the corresponding parts of the document

L IE8 and earlier versions do not support "DOM2-level traversal and scope", but it provides a proprietary text range object that can be used to perform simple text-based scoping operations. IE9 full support for DOM traversal

Javacript Advanced Programming-dom2 and DOM3

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.