I wanted to see if you could Detect caps lock in JavaScript. Why? As a small usability touch, basically alerting users that caps lock is enabled when they are entering passwords for example. I’ve wrapped up the Logic in a simple function that can help you detect Caps Lock On a key press. Here is the demo and following is the function followed by a simple usage.