showing results for - "how to find out what character key is pressed 3f 23key 23keycode 23code"
Jona
28 Jun 2019
1<table>
2<tr><td>Key:</td><td id="key"></td></tr>
3<tr><td>Key Code:</td><td id="keyCode"></td></tr>
4<tr><td>Event Code:</td><td id="eventCode"></td></tr>
5</table>
6<script type="text/javascript">
7window.addEventListener("keydown", function (e) {
8  //tested in IE/Chrome/Firefox
9  document.getElementById("key").innerHTML = e.key;
10  document.getElementById("keyCode").innerHTML = e.keyCode;
11  document.getElementById("eventCode").innerHTML = e.code;
12})
13</script>