jQuery parent()
- by Happy
jQuery snippet:
$(".sliders dt a").click(function(){
$(this).parent().parent().parent().find(".triggers a").removeClass("active");
return false
});
HTML:
<div class="triggers"><a href="#" class="active">Hide all</a></div>
<dl class="sliders">
<dt><a href="#">text</a></dt>
<dd>text</dd>
</dl>
Three .parent() is used, to catch .triggers block. Is there any way to merge them?