Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Press a key on the keyboard in the input field to find out if the META key was pressed or not.</p> <input type="text" onkeydown="isKeyPressed(event)"> <p id="demo"></p> <script> function isKeyPressed(event) { var x = document.getElementById("demo"); if (event.metaKey) { x.innerHTML = "The META key was pressed!"; } else { x.innerHTML = "The META key was NOT pressed!"; } } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_key_metakey by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:30:44 GMT --> </html>
Result:
Try it Yourself - © w3schools.com