Bad code Bad code
<a href="#form" role="button" aria-haspopup="true"> Register </a>
Issues and how to fix them Issues and how to fix them
It’s a link to a form at the same page that looks like a button.
- By adding
role="button"
to a link, you’re telling that it’s a button, though it acts like a link. Do not change native semantics, unless you really have to. aria-haspopup="true"
suggests that there’s a popup, but it doesn’t exist.- Padding should be added via CSS, not
.
Good code Good code
.button {
/* use CSS to apply button-like styles to the link */
}
<a class="button" href="#form"> Register </a>