I have the following code.
.has() seems to be designed for this purpose. Since it returns a jQuery object, you have to test for .length as well:
.length
if ($('div#hello').has(target).length) { alert('Target is a child of #hello'); }