I would like to change the css style of all anchors without attribute href.
href
I can use the selector to select anchors that start with something using $('a[href^="some_link"]'). But I want it to be the other way around. How can I select bindings without href using jquery?
$('a[href^="some_link"]')
Also, can I achieve this with the css selector?
Thank.
You need this selector (jQuery / CSS compatible):
a:not([href])
If you need IE support (because of this :not()), use it as a jQuery selector. Otherwise, you can use it for a CSS rule.
:not()
$("a").filter(function() { return !this.attributes['href']; }).
$("a").filter(function() { return !this.attributes['href']; })
, , Sizzle ( querySelectorAll).
http://jsfiddle.net/9PWQB/