是否可以使用jQuery一次删除所有属性
<;img src=”https://stackoverflow.com/questions/1870441/example.jpg“width=“100”height=“100”>;
到
<;img>;
我尝试了$('img')。removeAttr('*')</没有运气。有人吗
一个不需要JQuery的简单方法:
while(elem.attributes.length>;0)
elem.removeAttribute(elem.attributes[0].name);