Links
http://domain.com/[random]/#foo
http://domain.com/[random]/bar
How to select the links that start with http://domain.com/ and then wildcard ([random]) and then #?
You could do something like this:
$('a[href^="http://domain.com/"][href$="#foo"]');
That selects a
elements having an href
that starts with http://domain.com/
and ends with #foo
.
If you don't care about the foo
part and only care about the hash, use this instead:
$('a[href^="http://domain.com/"][href*="#"]');
The second part of the select is the "contains" filter.
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