Full-stack JavaScript (9) Understanding DocumentType nodes

Source: Internet
Author: User

The DocumentType includes all doc-related doctype information. Currently, only Firfox, safri, Chrome, and Opera are supported. The constructor function is function DocumentType () {[native code]}.


DocumentType node features:


  • NodeType: 10,
  • NodeName: name of doc type
  • NodeValue: The value is null.
  • PrasentNode: the parent node is a Document node.
  • No subnode ..


Browsers that support the DocumentType type Save the DocumentType node in document.doc type,

It has three attributes: name, entities, notitions, and name, which indicate the name of the document type. entities and notations are all NamedNodeMap objects, a description entity, and a description symbol.


In the browser, whether html or xhtml documents, entities, and notitions are all undefined, and only the name attribute is useful.


DocumentType nodes are not commonly used in Web browsers and cannot be dynamically created. They can only be created by the browser when parsing documents. In IE 8 and earlier versions, documenttypetype is not supported, because the document.doc type value is always equal to null. However, these browsers incorrectly interpret the document type declaration as a comment and create a comment node for it. IE9 will assign the correct object to document.doc type, but does not support access to DocumentType.

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.