javascript中如何使用setAttributeNode方法

2024-12-19 19:02:14

1、创建一个名称为setAttributeNode 的html文件

javascript中如何使用setAttributeNode方法

3、添加一个button按钮,在点击事件中加入自定义函数my衡痕贤伎setAttributeNode添加一p标签,设置id 为 showsetAttributeNode

javascript中如何使用setAttributeNode方法

5、在自定义函数中获取h1元素对象,创建一个节点属性 class,并设置节点的内容为m鲻戟缒男yclass,h1元素对象添加节点属性

javascript中如何使用setAttributeNode方法javascript中如何使用setAttributeNode方法
猜你喜欢