SyntaxFix
Write A Post
Hire A Developer
Questions
There's actually quite a simple native method for this:
if( $('#myfav')[0].hasChildNodes() ) { ... }
Note that this also includes simple text nodes, so it will be true for a <div>text</div>.
<div>text</div>