Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>Is the Shift Key Pressed?</h1> <p>Click in the input field, then hold down the Shift key and click in the input field again:</p> <input type="text" size="40" onmousedown="myFunction(event)"> <p id="demo"></p> <script> function myFunction(event) { let x = event.getModifierState("Shift"); document.getElementById("demo").innerHTML = "Pressing the shift key: " + x; } </script> </body> </html>