Suppose I have the following HTML:
One Two
You can do it like this
$("li").not('.foo li')
http://jsfiddle.net/y7s54/
or
$("li:not(.foo li)")
http://jsfiddle.net/QpCYY/
Select all li's that don't have an ancestor with class foo