jQuery 回車事件enter使用示例
更新時間:2014年02月18日 10:55:48 作者:
這篇文章主要介紹了jQuery 回車事件enter的使用,需要的朋友可以參考下
eg:
//點擊enter,用戶登陸
$("#txtLoginPwd").keydown(function (e) {
if (e.which == 13) {
UserLogin();
}
});
注意:是“keydown”而不是“keypress”
復制代碼 代碼如下:
//點擊enter,用戶登陸
$("#txtLoginPwd").keydown(function (e) {
if (e.which == 13) {
UserLogin();
}
});
注意:是“keydown”而不是“keypress”