EDITABLE CODE:
LiveDemo:jQuery - Closest() Method
Note:If no matches are found , then all the ancestors are selected.