Describe the new a11y feature or project enhancement
Anchor tags should not be used as buttons, it is bad for accessibility and usability. Links should redirect to a resource/page, if they don't they probably should be buttons.
Describe the solution you'd like
Display a warning if a link is being used as a button. Examples of links being used as buttons:
<a href="#">Do something</a>
<a href="javascript:void(0)" role="button">Do another thing</a>
<a href="javascript:doSomething(0)">Do another thing</a>
Basically, what should trigger the warning would be:
- An anchor tag with
href="#" (a link that doesn't go anywhere)
- An anchor tag with
href starting with "javascript:" (a link that calls a function instead of redirecting)
- As a bonus, any anchor tag (or any element different than a button or input) that has
role="button" should probably display the warning.
Link(s)
Describe the new a11y feature or project enhancement
Anchor tags should not be used as buttons, it is bad for accessibility and usability. Links should redirect to a resource/page, if they don't they probably should be buttons.
Describe the solution you'd like
Display a warning if a link is being used as a button. Examples of links being used as buttons:
Basically, what should trigger the warning would be:
href="#"(a link that doesn't go anywhere)hrefstarting with "javascript:" (a link that calls a function instead of redirecting)role="button"should probably display the warning.Link(s)