avatar

sunday

Sunday's Blog

  • 首页
Home javascript检测键盘是否开启大写状态
文章

javascript检测键盘是否开启大写状态

Posted 2024-07-19 Updated 2024-07- 19
By sunday
0~1 min read
document.querySelector('input[type=password]').addEventListener('keyup', function (keyboardEvent) {
    const capsLockOn = keyboardEvent.getModifierState('CapsLock');
    if (capsLockOn) {
        // Warn the user that their caps lock is on?
    }
});

来源:https://davidwalsh.name/detect-caps-lock

javascript, 软件使用
软件使用 javascript
License:  CC BY 4.0
Share

Further Reading

Jul 19, 2024

javascript检测键盘是否开启大写状态

document.querySelector('input[type=password]').addEventListener('keyup', function (keyboardEvent) { const capsLockOn = keyboardEvent.getModifierSt

OLDER

青龙面板使用api(openapi)接口请求执行任务

NEWER

github actions 发送Axios请求并获取JSON数据

Recently Updated

  • nextjs使用three.js写一个3D模型的查看器Viewer
  • nextjs15使用better-sqlite3的连接报错问题
  • nextjs + clerk + supabase + realtime 实时监听数据库更改
  • 解决nextjs15使用useLocalStorage报错的问题
  • mac上使用nodejs appium控制chrome浏览器

Trending Tags

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

Contents

©2025 sunday. Some rights reserved.

Using the Halo theme Chirpy