Check if an element is a child of another element
jQuery.fn.isChildOf = function(b){ return (this.parents(b).length > 0); };