I'm trying to call a function only if an HTML element is empty, using jQuery.
Something like this:
if (isEmpty($('#element'))) {
// do something
}
I'm trying to call a function only if an HTML element is empty, using jQuery.
Something like this:
if (isEmpty($('#element'))) {
// do something
}
Empty as in contains no text?
Here's a jQuery filter based on https://stackoverflow.com/a/6813294/698289
If by "empty", you mean with no HTML content,
JavaScript
try using any of this!
Yes, I know, this is not jQuery, so you could use this:
Happy now?