Dear Web Devs, Please Use Anchors Instead of Divs for Buttons

Shane Duffy
2 min readFeb 22, 2022

--

I get it, you’re using React or Angular, and you don’t need to use <a> for your web app’s buttons. But do it for us, the keyboard purists.

Since I’d like to eventually do the “digital nomad” thing for awhile, I made it a point to become accustomed to working on a laptop. In other words, becoming a “keyboard purist”.

As far as development tools go, there is plenty of keyboard support, naturally. But desktop apps? No such luck. And web apps are even worse.

Enter Vimium, the amazing Chrome extension that makes it possible to traverse the web with nothing but your keyboard! Assuming the website you’re on uses anchors for buttons…

My First Userscript

Standard Notes is an awesome open source, cross platform app for note taking. I love the simplicity of it. And I’m constantly switching to it to edit and lookup notes while I’m developing. However, they recently changed some of the buttons to be divs instead of anchors, and thus I have been quickly developing carpal tunnel from having to constantly switch to my mousepad to click around. It is terribly frustrating. I spent some time searching around, and posted on the subreddit about it, but it looks like the devs don’t intend to implement keyboard support anytime soon.

Normally, I’d just avoid apps that don’t have good keyboard shortcut (or Vimium) support, but in this case I was already a bit too invested into Standard Notes. So, I decided to write a Userscript to change the elements in question to be anchors again:

Vimium Standard

In hindsight, Standard Notes is open source, so I probably could have just done a PR. Oops.

--

--

Shane Duffy
Shane Duffy

No responses yet