Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select anchors without href

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.

like image 986
Kamyar Avatar asked Sep 12 '11 11:09

Kamyar


1 Answers

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.

like image 91
BoltClock Avatar answered Sep 20 '22 20:09

BoltClock