Answer by Nick Craver for Using Jquery to get the div id?
Use .closest(selector) to crawl up to that parent, like this:$("#some_id").click(function() { var test = $(this).closest('.first').attr('id'); alert(test); return false;});You can give it a try here....
View ArticleUsing Jquery to get the div id?
How can I get DIV id or DIV class using Jquery if the HTML is similar to:<div class="first" id="first_id"><div class="second">text sample</div><div class="third"><button...
View Article
More Pages to Explore .....