Remove all attributes

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

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


to



        
9条回答
  •  庸人自扰
    2020-11-27 04:32

    This will remove all attributes and it will work for every type of element.

        var x = document.createElement($("#some_id").prop("tagName"));
        $(x).insertAfter($("#some_id"));
        $("#some_id").remove();
    

提交回复
热议问题