check if clicked element has ancestors jquery code example Example: select parent of element jquery $(this).parent(); // jquery