Detailed description of Dom Element Node nodetype values

Source: Internet
Author: User
Tags comparison table
Element nodetype values
Returned integer Node type constant
1 Element_node
2 Attribute_node
3 Text_node
4 Cdata_section_node
5 Entity_reference_node
6 Entity_node
7 Processing_instruction_node
8 Comment_node
9 Document_node
10 Document_type_node
11 Document_fragment_node
12 Notation_node

General Chinese comparison table:

Dom Element Node nodetype Value
Integer Constant
1 Element_node, a common element node, such as <HTML>, <p>, <div>, <span>,
2 Attribute_node, element attribute
3 Text_node: text node
4 Cdata_section_node, that is, <! [CDATA []>
5 Entity_reference_node, object reference, such as & amp; & nbsp;
6 Entity_node, entity, such as <! Entity copyright "Copyright 2010, impng. All Rights Reserved"]>
7 Processing_instruction_node, PI, Processing Command, as shown in <? XML version = "1.0"?>
8 Comment_node, comment <! ->
9 Document_node, the root node, that is, document. nodetype
10 Document_type_node, DTD, document type <! Doctype>
11 Document_fragment_node, file segment
12 Notation_node, the mark defined in DTD

 
Note that in IE, spaces/TAB/line breaks in HTML are directly skipped, while spaces in Firefox are considered to be a node. ThereforeNextsiblingOrPreviussiblingYou need to determine whether it is an element node.

1234 var
el = $(
'#demo');do
{
el = el.nextSibling;} while(el.nodeType != 1);

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.