且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

只用一个& nbsp;使用jQuery的空间

更新时间:2022-10-14 22:00:25

Try:

$('p')
    .filter(function() {
        return $.trim($(this).text()) === '' && $(this).children().length == 0
    })
    .remove()

What that does is it finds all the <p>s that have nothing in them, and removes them from the DOM.

相关阅读

技术问答最新文章