how do I select every class mem开发者_Python百科ber except the one that is the parent of $(this)?
How about:
$(".your-class").not($(this).parent())
Try this:
$('.myClass').not(this.parentNode);
This will have significantly better performance than using $(this).parent()
, because it doesn't involve creating a new jQuery object.
精彩评论