jQuery-多个:非选择器 [英] jQuery - multiple :not selector

查看:265
本文介绍了jQuery-多个:非选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试定位不以'#'开头并且不包含内嵌javascript的页面范围的链接,但是我在确定如何正确构造选择器时遇到问题.

I'm trying to target page-wide links that do not start with a '#' and do not include in-line javascript but I'm having problems figuring out how to structure the selector properly.

根据我搜索过的多个选择器的信息,这两个选择器可以独立工作,而不能一起工作!

Based on what I've googled about multiple selectors this should work, both selectors work independently, just not together!

$('a:not([href*=javascript]), a:not([href^=#])')
.each(function(){...

推荐答案

尝试使用

$('a:not([href*=javascript]):not([href^=#])') ...

这篇关于jQuery-多个:非选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆