Need to check if an HTML div is empty and contains no text and no child elements as such inside it – a black page only.
e.g
function isPageEmpty(page) {
const paragraphNodes = page.querySelectorAll(".paragraph");
if ((paragraphNodes[0].children[0]).innerText !== "") {
return false;
}
return true;
}
What would be the best way to do it, current code causing re calculation of styles?
Open for suggestion and new ideas.