<div><p></p><p> </p><p> </p></div>
<script>
var p = document.getElementsByTagName('p');
var re = /^\s*$/m;
[].forEach.call(p, function(el) {
var parent_element = el.parentNode;
if (re.test(el.textContent)) {
setTimeout(function() {
parent_element.removeChild(el);
}, 0);
}
});
</script>