<html>
<body>
<h1>Keyboard Events</h1>
<h2>The charCode Property</h2>
<p>Press the "O" key on the keyboard in the input field to alert some text.</p>
<p>The charCode property is deprecated. Use the key property instead.</p>
<input type="text" size="40" onkeypress="myFunction(event)">
<p id="demo"></p>
<script>
function myFunction(event) {
let value = event.charCode || event.keyCode;
if (value == 111 || value == 79) { // o is 111, O is 79
alert("You pressed the 'O' key!");
}
}
</script>
</body>
</html>