skip to Main Content

Detect caps lock in HTML input element

I want to detect CapsLock in an input. I used getModifierState which I found here: function handle(ev, el) { //if (ev.isComposing || ev.keyCode === 229) return; // for firefox let isCapsLockOn = ev.getModifierState('CapsLock'); document.getElementById('message').innerText = isCapsLockOn ? 'CAPS LOCK' :…

VIEW QUESTION
Back To Top
Search