views:

51

answers:

2

Hi, 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

+5  A: 

Try the :not() selector or not method:

$("h1:not(.myclass)")
$("h1").not(".myclass")
Gumbo
+5  A: 
$("h1:not('.myclass')")

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

Tim
woohps too late ;)
Tim
+1 for link to API reference. Insert "Give a man a fish/teach a man to fish" to analogy here.
Conspicuous Compiler
+1 because Gumbo needs more rep.
ChaosPandion