HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>Press a key on the keyboard in the input field</p> <input type="text" onkeydown="myFunction(event)"> <p>The pressed key was: <span id="point"></span></p> <script> function myFunction(event){ document.getElementById("point").innerHTML = event.which; } </script> </body> </html>
OUTPUT
×

Save as Private