mTuran
mTuran

Reputation: 1834

Question about jQuery Selectors

i want to select all h1 tags except myclass with jQuery. For example i want select < h1> but i don't want to select < h1 class="myclass">

Thanks

Upvotes: 2

Views: 77

Answers (2)

Tim
Tim

Reputation: 9489

$("h1:not('.myclass')")

http://api.jquery.com/not-selector/

Upvotes: 5

Gumbo
Gumbo

Reputation: 655795

Try the :not() selector or not method:

$("h1:not(.myclass)")
$("h1").not(".myclass")

Upvotes: 5

Related Questions