How to remove elements with whitespace?

前端 未结 5 919
暖寄归人
暖寄归人 2020-12-17 01:09

I can easily remove a tag that has no blank spaces...

$(\'h2:empty\').remove();

But, when there is a space...

&l

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 01:38

    This will only check for one space, but works for a basic example:

    $("h2:contains(' ')").remove()
    

提交回复
热议问题