jQuery hasParent helper. Checks if the selected element has a defined parent element.