<html>
<body>
<h1>KeyboardEvent code Property</h1>
<p>Press a key on the keyboard in the input field:</p>
<input type="text" size="40" onkeypress="myFunction(event)">
<p>The code property returns the name of the key you pressed:</p>
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.code;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_key_code by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:03:01 GMT -->
</html>