How do I check if an HTML element is empty using jQuery?

I’m trying to call a function only if an HTML element is empty, using jQuery.

Something like this:

if (isEmpty($('#element'))) {
    // do something
}

18 Answers
18

Leave a Comment