Prev Demo
JavaScript
>
Keycode
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Find Keycode unicode values.</h1> <p>Place the cursor inside the textbox and press any key of the keyboard to know the Unicode of the OnPressKey</p> <input type="text" size="45" onkeypress="myEvent(event)"> <p id="myId"></p> <script> function myEvent(event) { var R = event.which || event.keyCode; //* In some browsers keycode property does not work, in that case which property helps to get the output. So, we used both properties event.which OR event.keycode *// document.getElementById("myId").innerHTML = "The Unicode of the OnPress Key is: " + R; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output