/js-caps-lock

Simple JS code snippet for detecting if caps lock is on

Primary LanguageHTML

js-caps-lock

I searched for a long time for a way to create a fully working caps lock detector with js for password fields. A lot of the code I found worked only in some parts, for example if you press caps lock it doesn't update automatically or if you press shift it says caps lock is off when its not.

This way we always look at the state of the caps lock not at the state of the characters you type.

For a demo you can look at this fiddle: http://www.jsfiddle.net/e50nmrtz/4/