JavaScript中节点的类型、节点名称、节点值和属性的操作
工具/原料
电脑,DW软件
方法/步骤
1
nodeType 节点类型
2
nodeName 节点名称
3
nodeValue 节点值
4
节点信息各属性
5
属性的操作一:getAttribute();获取属性值
6
属性的操作二:setAttribute();设置属性值
注意事项
div.setAttribute('class','hover');也可以用div.className ='hover';
电脑,DW软件
nodeType 节点类型
nodeName 节点名称
nodeValue 节点值
节点信息各属性
属性的操作一:getAttribute();获取属性值
属性的操作二:setAttribute();设置属性值
div.setAttribute('class','hover');也可以用div.className ='hover';