Saturday, November 28, 2009

Re: [jQuery] Selector Help

$('a.filter').click(function(){
    $(this).parent().addClass('active');
});

Dave Maharaj :: WidePixels.com wrote:
How would I go about adding  class to the li in this set up?   <li><a href="#" class="filter"><span>all</span></a></li> <li><a href="#" class="filter"><span>some</span></a></li> <li><a href="#" class="filter"><span>none</span></a></li>  $('a.filter').click(function(){ $(???).addClass('active'); });  Thanks  Dave     

No comments: