3 ms·
a:not([href]) a[href="#"], a[href=""], a[href*="javascript:void(0)"] { … } Wait, what should I use instead then?
by yokohummer7 10y ago
a:not([href])
a[href="#"],
a[href=""],
a[href*="javascript:void(0)"] { … }
Wait, what should I use instead then?
- jacobr 10y agoThe button element should be used for interaction that is not navigation to a different url.
- jontro 10y agoWhat about anchors using name?
- lexicality 10y agoThey've been deemed obsolete with HTML5 - you should use the id attribute on the element the <a> would be naming.
- tompazourek 10y agoI was thinking the same when I saw that... Not sure if it's viable, but maybe buttons?
- oneeyedpigeon 10y agoAlways supply an href so JavaScript-less viewers can still activate the link. Attach events via JavaScript rather than HTML attributes.