2021
01-12
01-12
JS removeAttribute()方法实现删除元素的某个属性
在JavaScript中,使用元素的removeAttribute()方法可以删除指定的属性。用法如下:removeAttribute(name)参数name表示元素的属性名。示例1下面示例演示了如何动态设置表格的边框。<script>window.onload=function(){//绑定页面加载完毕时的事件处理函数vartable=document.getElementByTagName("table")[0];//获取表格外框的引用vardel=document.getElementById("del");varreset=document.getEl...
继续阅读 >