HTML DOM property

innerHTML property
  easiest way to obtain the content of the element is to use innerHTML property
  innerHTML properties or alternatively to the content acquisition HTML elements useful
  innerHTML property may be used to obtain or alter any HTML elements, including <html> and <body>


nodeName property
  name nodeName property of a given node, read-only
  different node types nodeName call attribute, the value returned is different, such as:
    <element node> .nodeName, returns the tag name
    <attribute node> .nodeName, returns the attribute name
    <text node > .nodeName, return #text
    <document node> .nodeName, return #document
    Note: nodeName always contains elements of HTML tag name in capital letters


nodeValue property
  value of the property nodeValue predetermined node, different node types nodeValue call attribute, the value returned is different, such as:
    <element node> .nodeValue, return null or undefined
    <text node> .nodeValue, returns the text itself
    <attribute node> .nodeValue, returns the attribute value


nodeType property
  nodeType property returns the type of node, read
  the following element types and return values corresponding relationship nodeType

    <Element node> .nodeType, returns an
    <attribute node> .nodeType, 2 returns
    <text nodes> .nodeType, returns 3
    <comment node> .nodeType, returns 8
    <document node> .nodeType, returned 9

Guess you like

Origin www.cnblogs.com/shiliye/p/12020747.html