# Detect Caps Lock with JavaScript

DevFeed: [Detect Caps Lock with JavaScript](<https://devfeed.tech/articles/detect-caps-lock-with-javascript-37478.md>)

Original publisher: [Read original article](<https://davidwalsh.name/detect-caps-lock>)

Author: David Walsh

Published: 2024-02-06T10:33:10Z

Content type: tutorial

Language: en

Sources: [David Walsh](<https://devfeed.tech/sources/david-walsh.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [passwords](<https://devfeed.tech/topics/passwords.md>), [keyboard](<https://devfeed.tech/topics/keyboard.md>), [Users](<https://devfeed.tech/topics/users.md>)

Tags: [javascript](<https://devfeed.tech/tags/javascript.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [password](<https://devfeed.tech/tags/password.md>), [users](<https://devfeed.tech/tags/users.md>)

## AI overview

A tutorial explaining how to detect whether Caps Lock is enabled during keyboard events with JavaScript, helping developers warn users when entering passwords.

## Source excerpt

Anyone is capable of having their caps lock key on at any given time without realizing so. Users can easily spot unwanted caps lock when typing in most inputs, but when using a password input, the problem isn't so obvious. That leads to the user's password being incorrect, which is an annoyance. Ideally developers could [...] The post Detect Caps Lock with JavaScript appeared first on David Walsh Blog.