jQuery keyup() 方法
jQuery 教程
· 2019-03-09 21:27:11
实例
当键盘键被松开时,设置 <input> 字段的背景颜色:
$("input").keyup(function(){
$("input").css("background-color","pink");
});
定义和用法
与 keyup 事件相关的事件顺序:
- keydown - 键按下的过程
- keypress - 键被按下
- keyup - 键被松开
当键盘键被松开时发生 keyup 事件。
keyup() 方法触发 keyup 事件,或规定当发生 keyup 事件时运行的函数。
提示:请使用 event.which 属性来返回哪个键被按下。
语法
触发被选元素的 keyup 事件:
$(selector).keyup()
添加函数到 keyup 事件:
$(selector).keyup(function)
| 参数 | 描述 |
|---|---|
| function | 可选。规定 keyup 事件触发时运行的函数。 |
点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html
Head First Rails
David Griffiths / O'Reilly Media / 2008-12-30 / USD 49.99
Figure its about time that you hop on the Ruby on Rails bandwagon? You've heard that it'll increase your productivity exponentially, and allow you to created full fledged web applications with minimal......一起来看看 《Head First Rails》 这本书的介绍吧!