I\'m using jQuery. I want to find the closest class .hidebox
to the element that created the event. I tried to use parent
, find
and
As suggested by Rory McCrossan; your first HTML: JQuery code:hideBox
present directly in tag which is invalid; and 2nd
hideBox
's present outside of which is also invalid. So I am using below HTML which is somewhat different from yours but I believe you want that only
show div
show div
$(".hideBox-tab").click(function(){
$(this).closest("tr").find(".hideBox").toggle();
return false;
});