<html>
<body>
<p>Press the "O" key on the keyboard in the input field to alert some text.</p>
<input type="text" size="40" onkeypress="myFunction(event)">
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.charCode || event.keyCode;
if (x == 111 || x == 79) { // o is 111, O is 79
alert("You pressed the 'O' key!");
}
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_key_charcode3 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:03:00 GMT -->
</html>