3 ms·
No, it's the absolute worst kind of anchor link: it's linking to javascript:void(0). It should be a button. Not complicated.
by robertoandred 6y ago
No, it's the absolute worst kind of anchor link: it's linking to javascript:void(0). It should be a button. Not complicated.
- ratww 6y agoRead again. The point was that it should be a button that looks like a button, or a link with proper fallback for non-JS users. It should have a title attribute and feedback as well, for screen readers. It should never be a button disguised as a link, however. Fake links are much worse than javascript:void(0), because they break expectations of users, and are more prone to breaking. At least with javascript:void(0) browsers are able to use it as a hint to disable certain context-menu items, and it's much better than having a fake link. For accessibility purposes, if you need button behavior but link-look you should use role="button".
- mwcampbell 6y ago> The point was that it should be a button that looks like a button, or a link with proper fallback for non-JS users. And in case I wasn't clear, I agree with that.
- a1369209993 6y agoThe upvote link on your comment goes to [ https://news.ycombinator.com/vote?id=23327414&how=up&auth=51f460b4a5e8302f4ab6bf2d1dd7631902fab274&goto=item%3Fid%3D23327414#23327414 https://news.ycombinator.com/vote?id=23327414&how=up&auth=51... ] not [ javascript:void(0) ]. Are you sure you don't have RCE vulnerabilities enabled?