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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With