jQuery :empty Selector
Learn all about the jQuery function :empty Selector.
This is the inverse of :parent
.
One important thing to note with :empty (and :parent) is that child elements include text nodes.
The W3C recommends that the <p>
element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.