开发者

not class selector doesn't seem to work with anchor

I have a wrapped set like this:

var $anchors = $('a');

I then do some JQuery code to confirm a deletion and etc... everything was working great until I started adding other anchors to my site that hav开发者_C百科e classes that do different things

I'm trying to use the :not in JQuery to eleminate certain classes from this generic anchor wrapped set, so that the configme delition and etc doesn't occur, but can't seem to get it to work... what am I missing? Here is the updated selector I am trying to use:

var $anchors = $('a:not(".excludedanchorclass")');


No quotes:

var $anchors = $('a:not(.excludedanchorclass)');


You can also use jquery filter

var $anchors = $('a').filter(':not(.excludedanchorclass)');
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜