check if element has childs jquery

JavaScript
if ( $('#myfav').children().length > 0 ) {
     // do something
}

Source

Also in JavaScript: