views:

49

answers:

3

Whats wrong with this CSS selector i'm using in jQuery? Trying to select all tr's within a table of ID "itable" without a class of "mod" where its possible for multiple classes to be on each tr.

if($('#itable tr:not[class~=mod]').length == 0){
    //something
}
+1  A: 
#itable tr:not(.mod)
David Dorward
+3  A: 
if($('#itable tr:not(.mod)')[0]){
    //something
}
Nimbuz
+1  A: 

youre using the :not selector the wrong way http://docs.jquery.com/Selectors/not#selector

if($('#itable > tr:not(.mod)').length == 0){
    //something
}
Tim