Remove all attributes

后端 未结 9 679
天涯浪人
天涯浪人 2020-11-27 04:01

Is it possible to remove all attributes at once using jQuery?


to



        
9条回答
  •  感情败类
    2020-11-27 04:53

    One-liner, no jQuery needed:

    [...elem.attributes].forEach(attr => elem.removeAttribute(attr.name));
    

提交回复
热议问题