How to get parent element by specified tag name using jquery?
See .closest()
:
Get the first ancestor element that matches the selector, beginning at the current element and progressing up through the DOM tree.
I.e.,
$('#myId').closest('table')
(Demo)