Get your own website Result Size: 625 x 565
x
 
<!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><strong>Note:</strong> The getModifierState() method is not supported in Safari 10 or IE 8 and earlier versions.</p>
<p id="demo"></p>
<script>
function myFunction(event) {
  var x = event.getModifierState("CapsLock");
  document.getElementById("demo").innerHTML = "Caps Lock activated: " + x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_event_key_getmodifierstate by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:52:54 GMT -->
</html>