Just to add, as .not returns a jQuery object you can check it's length (is() should be more efficient):
if ( $(this).not(":contains('Offenburg')").length ) On May 28, 9:30 am, Alaa <ala...@gmail.com> wrote: > Thanks, > > Actually I know that the complement to $('foo').is() is !$('foo').is > (), but I wanted to try the ".not" > > and now it works as expected using this code: > > $("#isDiv> div").not(":contains('Offenburg')") > .bind("click", function(e){ > alert('Not Offenburg'); > });