html - How can I select all the empty tag using jQuery.? -
this question has answer here:
how can select empty tag using jquery.
i want select
<p></p> <p style="display: block"></p> <p> </p> <p> </p> <p> </p>
and not
<p>0</p> <p>test</p>
i tried :empty
not working options. on appreciated.
you can using jquery.filter()
.
var empty_p = $('p').filter(function(){ return !$.trim($(this).text()); }).get();
Comments
Post a Comment