博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DOM节点属性
阅读量:6937 次
发布时间:2019-06-27

本文共 347 字,大约阅读时间需要 1 分钟。

1. nodeName : 节点的名称

   1. 元素节点的 nodeName 与标签名相同

   2. 属性节点的 nodeName 是属性的名称
   3. 文本节点的 nodeName 永远是 #text
   4. 文档节点的 nodeName 永远是 #document

2. nodeValue :节点的值

   1. 元素节点的 nodeValue 是 undefined 或 null

   2. 文本节点的 nodeValue 是文本自身
   3. 属性节点的 nodeValue 是属性的值

3. nodeType :节点的类型

    元素类型    节点类型

      元素          1
      属性          2
      文本          3
      注释          8
      文档          9

转载于:https://www.cnblogs.com/family-626-77/p/5687196.html

你可能感兴趣的文章