title: JS function when keyboard key is pressed?
body: <p>Is there a way to run a JavaScript function when a key is pressed and released? </p>
  
  <p>For example, how would I run a function <code>example()</code> when the <kbd>T</kbd> key is pressed? I've seen examples of these before, but they were long and messy, and I couldn't get them to work. Would something like this just go in a <code>&lt;script&gt;</code> in the <code>&lt;head&gt;</code>?</p>