DOM(HTML中节点的获取)
发布日期:2021-05-06 22:12:51 浏览次数:34 分类:技术文章

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

内容
 

元素节点/文本节点/属性节点的nodeName/nodeValue/nodeType区别:

 

              noteType            nodeName             nodeValue   

元素节点         1             当前元素标签名           null

属性节点         2              当前属性名称             当前属性的值

文本节点         3              #text                    当前文本内容

代码
      index.html	    
百度一下
王健林
马云
马化腾
李彦宏
刘强东
 
 

结果

A  index.html:13:10

null  index.html:13:10
1  index.html:13:10
--------------------------  index.html:13:10
href  index.html:13:10
#  index.html:13:10
2  index.html:13:10
--------------------------  index.html:13:10
#text  index.html:13:10
百度一下  index.html:13:10
3

上一篇:jquery转义符
下一篇:Java Date,long,String 日期转换

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年04月14日 13时31分17秒