When I want to get, for example, the 3rd level parent of the element I must write $(\'#element\').parent().parent().parent() Is there a more optimal method for
$(\'#element\').parent().parent().parent()
As parents() returns a list, this also works
$('#element').parents()[3];