removeAttribute()


定义和用法

removeAttribute() 方法删除指定的属性。

此方法与 removeAttributeNode() 方法的差异是:removeAttributeNode() 方法删除指定的 Attr 对象,而此方法删除具有指定名称的属性。结果是相同的。同时此方法不返回值,而 removeAttributeNode() 方法返回被删除的属性,以 Attr 对象的形式。

参阅 removeAttributeNode() 方法