Javascript 7 -- javascript DOM (on)

Source: Internet
Author: User

What is DOM, not javascript? DOM is a document. DOM is a set of web standards used to describe how scripts interact and access structured documents. DOM defines a series of objects, methods, and attributes for accessing, manipulating, and creating content, structures, styles, and actions in a document. The role of inheritance in DOM when the browser parses a document file, each node is not a simple Element object instance, but inherits the extension of Element objects of many things.
The nodeName value nodeValue attribute corresponding to each Node type of the core object Node in the core Node object Node name, type, and value DOM2 is only applicable to a few DOM objects, in particular, Attr, ProcessingInstructions, Comments, Text, and CDATASection. In addition, the nodeValue attribute of all other objects returns null. The expected nodeValue for each nodeType specified in the DOM2 Core Specification: nodeType: The nodeType we saw earlier. It contains an integer value corresponding to a named constant in the following table. The constants listed in the table represent the core DOM objects. Therefore, you can determine the types of DOM core objects derived from a node. The nodeType constant of the DOM core object: Node nodes reference each other and attribute Node attributes: alert (baidu. attributes. getNamedItem ('href '). nodeValue); (to obtain a single attribute of a node) The following is the test code: [html] <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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.