(No idea if this is the right category. Mods: feel free to move this.)
Hi folks!
This is a thing I’ve been wondering for quite some time, so let’s settle the question once and for all!
Whenever I write a game that runs in the browser and I have links inside a sentence, I wonder what to use: the HTML anchor tag or the button tag? The anchor tag seems obvious because websites do it all the time, but then I wonder if a button tag isn’t the better choice.
First off the anchor tag gives me a dreadful status bar hover text in the bottom left
corner. I truly despise it and feel like it breaks my immersion when hovering over a link, especially if the game is styled in a way that clashes with its look. (It normally shows the site the link leads to, but in this case it shows some useless text anyway because we are not actually navigating.)
Secondly the anchor tag is not even semantically correct because we are not navigating to another site, we are just performing an action in the game.
So using a button always seemed like the better option to me. But then I realized that I don’t know jack about screen-readers and how that affects them. Is there anything that trips up screen readers when there is a button tag in the middle of a sentence? Or do interactive elements in the middle of a sentence just suck in general for screen readers and it would be better to have a dedicated screen-reader mode where all choices are given separately below?
Thanks!