开发者

Using Jquery, how to Grab all links with class 'c1' and has abcdef in the href

Using jquery, I want to get all links on the page with the css class 'c1' and that have 'abcdef' in the url of the href.

So far I know how 开发者_运维技巧to do:

$(".c1")


You can use an attribute-contains selector ([attr*=val]), like this:

$("a.c1[href*=abcdef]")


Try something like

$('a.c1[href*="abcdef"]')

For more on jQuery selectors see Selectors

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜