$(".element").parents();
.element
(including html
and body
) DEMO
To find any specific parent, suppose
container1
then$('.element').parents('.container1')
jQuery
.parents()
generally find all parents, but if you passed a selector then it will search for that.