When writing keyboard shortcuts on web pages, we often use the <code> tag in HTML, or equivalently, a pair of backticks in Markdown. As a result, these keys are styled as code. I have been thinking of styling them as <kbd> instead, which is more appropriate semantically, and <kbd> can have different visual styles with <code>.

Yesterday I wrote a short piece of JavaScript code to convert <code>Key</code> to …