运行 ❯
获取您
自身
网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>Is Caps Lock Activated?</h1> <p>Write som text in the input field, then activate the Cap Lock key and write some more text in the input field:</p> <input type="text" size="40" onkeydown="myFunction(event)"> <p id="demo"></p> <script> function myFunction(event) { let x = event.getModifierState("CapsLock"); document.getElementById("demo").innerHTML = "Caps Lock activated: " + x; } </script> </body> </html>