JQuery, selecting what does NOT contains something

user1722791 picture user1722791 · Dec 24, 2012 · Viewed 36.3k times · Source

If i want to select what contains "pc" i use $('tr:contains("pc")')

But what can i use to select what does NOT contains "pc"?

Answer

Ricardo Marimon picture Ricardo Marimon · Dec 24, 2012

Use the :not() selector that is part of the jquery framework. Something like $('tr:not(:contains("pc"))') should do the trick.