<html>
<body>
<h1>Is Caps Lock Activated?</h1>
<p>Click in the input field, then activate the Cap Lock 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("CapsLock");
document.getElementById("demo").innerHTML = "Caps Lock activated: " + x;
}
</script>
</body>
</html>