1$('#thisid').closest('li');
2
3// `closest()` is equivalent to (but performs better than)
4$('#thisid').parents('li').eq(0);
5$('#thisid').parents('li').first();
6
1/*
2For accessing parent element details by using reference of children element.
3Just Take a look on below example:
4*/
5
6<div id="parentDiv">
7 <p>Child paragraph element</p>
8</div>
9
10$(document).ready(function(){
11 alert($("p").parent().attr("id")); // output: parentDiv
12});
13
14/*
15I hope it will help you.
16Namaste
17*/