How to remove only tag using jQuery?

前端 未结 5 1752
心在旅途
心在旅途 2021-02-06 00:23

I want to remove the span using jQuery, I have tried the .unwrap(); but it\'s not working.


      
5条回答
  •  渐次进展
    2021-02-06 00:37

    $("span").each(function() {
        var content = $(this).text();
        $(this).remove();
        $("a").html(content);
    });
    

提交回复
热议问题