jQuery 属性操作 - removeAttr() 方法

实例

从任何 p 元素中移除 id 属性:

$("button").click(function(){
  $("p").removeAttr("id");
});

定义和用法

removeAttr() 方法从被选元素中移除属性。

语法

$(selector).removeAttr(attribute)
必需。规定从指定元素中移除的属性
posted @ 2020-08-05 17:38  有度科技  阅读(461)  评论(0)    收藏  举报