html - How to select all empty p tag using jQuery? -


how can select empty tag using jquery.

i want select

<p></p> <p style="display: block"></p> <p> </p> <p>     </p> <p>&nbsp;</p> 

and not

<p>0</p> <p>test</p> 

try

var t = $('p').filter(function(){     return $.trim($(this).text()).length == 0 }); 

demo: fiddle


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -