MojoDK
MojoDK

Reputation: 4528

JQuery find rows with "not" attribute

I know I can find rows with this JQuery...

$("[attr1][attr2]")....

This will find rows with with both attr1 and attr2.

But how can I find rows that has attr1, but NOT attr2?

Is there a...

$("[attr1]![attr2]")....

Thanks.

Upvotes: 0

Views: 31

Answers (1)

Felix
Felix

Reputation: 38102

You can use not():

$("[attr1]").not("[attr2]")

Upvotes: 1

Related Questions