<!DOCTYPE html>
<html>
<body>
<h1>Keyboard Events</h1>
<h2>The charCode Property</h2>
<p>Press a key on the keyboard in the input field to get the Unicode character code of the pressed key.</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;
document.getElementById("demo").innerHTML = "The Unicode value is: " + value;
}
</script>
</body>
</html>