牟骏荣博客


  • 首页

  • 安卓学习

  • Linux学习

  • 前端

  • 服务端

  • Python

JS-HTML获取键盘事件

Posted on 2019-03-24 | In 前端

JS-HTML获取键盘事件

  • 直接上代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    document.onkeydown = function (event) {
    let e = event || window.event || arguments.callee.caller
    .arguments[0];
    if (e && e.keyCode == 13) {
    //that.login()
    执行代码
    }
    //可以用console.log(e.keyCode) 获取你想捕获的 key
    };
  • 希望可以帮到你

# js
webStorm配置文件
django-查询语句
  • Table of Contents
  • Overview

牟骏荣

52 posts
11 categories
57 tags
loading css3 动态特效 android View angular drawable dom Scroll 鼠标拖动 express nodejs git 前端 ubuntu linux ionic relativelayout 相对布局 VSCode webview RecyclerView javascript nginx ueditor nodeJs shell chrome gitee VUE linearlayout 瀑布流 实例 php GPS 工具类 mongodb 百度地图 demo echart 图标 资源 Promise python 爬虫 webstorm js django sql 正则表达式 mongo intput 预览图片 验证码 close phone scroll
  1. 1. JS-HTML获取键盘事件
© 2019 牟骏荣