So essentially I have a ton of paragraph tags that contain inextricable spaces. Although I know that removing them and fixing the problem is a real problem - I am working on fixing a bandai to automatically remove them after the page loads through jQuery.
Essentially I have:
<p> </p>
A few hundred times per page.
I want to delete them all through jQuery, but of course I do not delete all the remaining paragraphs on the page that not only contain inextricable spaces.
It should be pretty simple, but for some reason I am not getting it; sort of:
if($.trim($('p').html()) == ' '){ $(this).remove(); }
This only applies to the first paragraph on the page, I need to hit them all.
source share