I'd like to change the css style of all the anchors without href
attribute.
I can use selector to select anchors that start with something using $('a[href^="some_link"]')
. But I want it to be vice versa. How can I select anchors without href using jquery?
Also, can I achieve this using a css selector?
Thank you.
You'll want this selector (jQuery/CSS compatible):
a:not([href])
If you need IE support (because of that :not()
), use it as a jQuery selector. Otherwise, you can use it for a CSS rule.
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