In the jQuery accordion API, it says "If the accordion is collapsing, ui.newHeader and ui.newPanel will be empty jQuery objects."
How can I check if ui.newheader is an empty jQuery object? I've tried it like this:
if ($(ui.newHeader) == null)
{
...
}
,like this:
if (ui.newHeader == null)
{
...
}
and this:
if ($(ui.newHeader) == "")
{
...
}
So basically, this is a question about jquery/javascript syntax :) Thanks
What you want is to know if there is 0 element in the set. Do it like this :
if ($(ui.newHeader).length==0) {
if (!$(ui.newHeader).length)
or
if (!$(ui.newHeader)[0])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With