如何禁用 <a> 的选项卡标签

问题描述:

我使用 标签作为网页上的链接.如何禁用 Tab 键选择其中任何一个?

I am using <a> tags for links on a web page. How do I disable the Tab key from selecting either of them?

您好,此答案的原作者.不要用这个.向下滚动.StackOverflow 不会让我删除这个答案,因为它被接受了.

Hi, original author of this answer here. Don't use this one. Scroll down. StackOverflow won't let me remove this answer since it was accepted.

您可以对这些链接执行以下操作:

You could do something like this for those links:

 <a href="http://foo.bar" onfocus="this.blur()">Can't focus on this!</a>

不过,您应该使用下面的答案.

You should use the answer below, though.

https://stackoverflow.com/a/457115/974680