Difference between revisions of "Team:Czech Republic/Template:Scripts"
Line 39: | Line 39: | ||
for (var i = 0, len = paragraphs.length; i < len; i++) { | for (var i = 0, len = paragraphs.length; i < len; i++) { | ||
var elem = paragraphs[i]; | var elem = paragraphs[i]; | ||
− | if (elem.childElementCount == 0 | + | if (elem.childElementCount == 0) { |
− | + | if (elem.textContent.trim() == '') { | |
− | + | elem.parentNode.removeChild(elem); | |
− | + | i--; | |
+ | len--; | ||
+ | } | ||
} | } | ||
− | + | } | |
} | } | ||
</script> | </script> |
Revision as of 16:46, 9 September 2015