jquery has child code example
Example 1: check if element has childs jquery
if ( $('#myfav').children().length > 0 ) {
// do something
}
Example 2: jquery is child of
if($(target).parents('.wrapper').length > 0) {
//do something...
}
if ( $('#myfav').children().length > 0 ) {
// do something
}
if($(target).parents('.wrapper').length > 0) {
//do something...
}