The only time I've ever thought to use an a as a button was for a login button in navigation, where the ask was for it to open up a modal on the page. Sounds great, until we realize some people don't have Javascript, so the purpose of using an a tag was as a fallback to link to a login page.
Javascript adds role="button", and if javascript is disabled, well then the role remains a link.
The only time I've ever thought to use an
aas a button was for a login button in navigation, where the ask was for it to open up a modal on the page. Sounds great, until we realize some people don't have Javascript, so the purpose of using anatag was as a fallback to link to a login page.Javascript adds
role="button", and if javascript is disabled, well then the role remains a link.It's very niche, and I guess I don't have much experience to talk, but that sounds like a really neat solution to an edge-case.