This if
-condition is what's giving me trouble:
if (div id=myfav has children) {
do something
} else {
do something else
}
I tried all the following:
if ( $('#myfav:hasChildren') ) { do something }
if ( $('#myfav').children() ) { do something }
if ( $('#myfav:empty') ) { do something }
if ( $('#myfav:not(:has(*))') ) { do something }