Wednesday, 18 September 2013

Is there such a jQuery selector that states 'all matched items except $(this)?

Is there such a jQuery selector that states 'all matched items except
$(this)?

here is a line of code that works except that it selects the item that was
clicked on. i want to select all items except what was clicked on.
$('ul.open').removeClass('open').addClass('close').slideUp();
my pseudo code something like this…
$('ul.open:not(' + $(this))).addClass('close').removeClass('open').slideUp();
thanks in advance,

No comments:

Post a Comment