How to get the container id in javascript or in jquery

thesting

New Member
I have some HTML blocks look like\[code\]<li id="item261"> <div class="itemdesc"> <a class="icon-hide">Hide</a> </div></li>\[/code\]And i have a jquery like \[code\]$(document).ready(function(){$('.icon-hide').click(function(){ var elemId = $(this).parent().attr("id"); });});\[/code\]I need the ID of the "li" tag on click of ".icon-hide". how can i achive this? any help..
 
Back
Top