小编典典

选择哪个 href 以某个字符串结尾

all

是否可以使用jQuery选择所有<a>href 以“ABC”结尾的链接?

例如,如果我想找到这个链接<a href="http://server/page.aspx?id=ABC">


阅读 110

收藏
2022-03-03

共1个答案

小编典典

   $('a[href$="ABC"]')...

选择器文档可以在http://docs.jquery.com/Selectors找到

对于属性:

= is exactly equal
!= is not equal
^= is starts with
$= is ends with
*= is contains
~= is contains word
|= is starts with prefix (i.e., |= "prefix" matches "prefix-...")
2022-03-03