jQuery的属性选择:任何东西,但不与指定的字符串结尾? [英] jQuery attribute selector: anything but not ending with specified string?

查看:146
本文介绍了jQuery的属性选择:任何东西,但不与指定的字符串结尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要选择在jQuery的元素,attibute值其中不符合指定的子结束

I need to select elements in jquery, attibute values of which do not end with a specified substring.

这必须是一个相当于的匹配所有元素,但那些在该属性与给定的子字符串结束的。

It must be an equivalent to "match all elements but those that end with a given substring in that attribute".

E [一!@#= finstr] 匹配E,E A =finstring等,并且不匹配è A =somethingfinstr,E A =finstr

So that e[a!@#=finstr] matches e, e a="finstring" etc, and does NOT match e a="somethingfinstr", e a="finstr".

帮助,谢谢。

推荐答案

沿东西线

$(':not([name$="finstr"])')

应该做的伎俩!

编辑:或者

$(selector).not('[name$="value"]');

这篇关于jQuery的属性选择:任何东西,但不与指定的字符串结尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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