if (div id=myfav has children){ do something } else { do something else }
The if condition is what's giving me trouble. 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 }