views:

274

answers:

2

This is probably pretty simple.

I want to select all elements of a given class "thisClass", except where the id is of a given id "thisId".

i.e. something equivalent to (where -/minus implies remove):

$(".thisClass"-"#thisId").doAction();

+8  A: 

Use the :not selector.

$(".thisclass:not(#thisid)").doAction();
rahul
+1  A: 

$(".thisClass[id!='thisId'").doAction();

Documentation on selectors: http://api.jquery.com/category/selectors/

Coronatus