[jQuery] Find if divs have any content
I am trying to loop through a div, and find any child divs that have
no content, if they don't an alert is thrown, if there is content, and
alert is thrown as well, but says that the content is full.
It does not seem to be looping through all of the elements within my
target div, I think I have something wrong with the each() function.
Any ideas?
$("#test").each(function() {
if ($("div").html() == "") {
alert("empty")
} else {
alert("full")
}
});
<div id="test">
<div id="text">Some text</div>
<div id="text1"></div>
</div>