It doesn’t look like there’s a way to do this in jQuery, but I thought I’d ask you fine folks if there’s a clever work around that will let me avoid parent().parent().parent() .
I’m basically looking to accomplish something like this: $('#myId').parent('li')
Try the
.closest()selectorThis will traverse up its ancestors in the DOM tree..
Check FIDDLE