" />
开发者

Question about jQuery Selectors

开发者 https://www.devze.com 2022-12-19 12:21 出处:网络
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\">

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


Try the :not() selector or not method:

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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号