jquery绑定回车事件
//回车事件绑定
$(".left-content").keyup(function(event){
var theEvent = event || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if(event.keyCode ==13){
$(".textbox-addon").click();
}
});
//回车事件绑定
$("#search-div").bind("keydown",function(e){
// 兼容FF和IE和Opera
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
//回车执行查询
$("#terminalList-search-btn").click();
}
});
<div id="search-div">
<input type="hidden" id="shipInfo_edit_shipId" value="${shipId}">
<fieldset>
<legend>${message("ov.terminalInfo.search")}</legend>
<form id="terminalList-search-form" class="search-form"> <input type="text" class="easyui-textbox" name="terminalId" validtype="length[0,20]"/> <input type="text" class="easyui-textbox" name="number" validtype="length[0,20]"/> </form>
<div class="search-item">
<button id="terminalList-search-btn" class="easyui-linkbutton" data-options="iconCls:'icon-search'">${message("ov.search")}</button>
</div>
</fieldset>
</div>
jquery绑定回车事件的更多相关文章
- JQuery 绑定回车事件 兼容ie8,ie9
$("#form-search").find('#search-query').bind('keypress', function(e) { var keycode; if(win ...
- input标签的accept属性、JQuery绑定keyDown事件
一. input标签的accept属性 当我们上传文件或者注册上传头像时,我们可以一般都是使用: <input type="file" id="my_file&qu ...
- 查看jquery绑定的事件函数
作为技术狂热分子的职业本能,看到一个技术产品的功能,总会忍不住想知道它是怎么被实现的.比如我每每看到别人网站一个很炫的界面或者很酷的功能,就忍不住打开了浏览器的控制台... 好,不扯远,说说当你想看到 ...
- jquery响应回车事件
简单地记下jquery实现回车事件,代码如下: 全局: $(function(){document.onkeydown = function(e){ var ev = document.all ...
- JS: javascript 点击事件执行两次js问题 ,解决jquery绑定click事件出现点击一次执行两次问题
javascript 点击事件执行两次js问题 在JQuery中存在unbind()方法,先解绑再添加点击事件,解决方案为: $(".m-layout-setting").unbi ...
- jquery 绑定回车(Enter )事件
全局: $(function(){ document.onkeydown = function(e){ var ev = document.all ? window.event : e; if(ev. ...
- js 给元素绑定回车事件
经常会看到登录页面输入完账户密码,回车就登录了.实现方法: JQuery方法: $("#focus")为获取id为focus的元素 $("#focus").ke ...
- js && Jquery 的回车事件
有时候我们需要捕获页面上的回车事件,以达到一些特殊效果,例如在登录页面用户输入完登录名和密码后习惯直接敲回车,这时需要捕获回车事件,在回车事件中激活form元素 1.纯Java Script版 首先要 ...
- vue:element-ui输入框绑定回车事件
参考: https://segmentfault.com/q/1010000011347642 https://weiku.co/article/297/ vue监听input输入框的回车事件:key ...
随机推荐
- Odd Gnome【枚举】
问题 I: Odd Gnome 时间限制: 1 Sec 内存限制: 128 MB 提交: 234 解决: 144 [提交] [状态] [命题人:admin] 题目描述 According to t ...
- Learning-Python【0】:Windows环境下Python2和Python3的安装
一.下载 可以在官网下载最新版本, 也可以在以下链接中找想安装的版本下载下来,这里以Python3.6和Python2.7为例 https://www.python.org/ftp/python/ 二 ...
- CSS基础学习(二) 之 width min-width max-width属性
width 1. 设置元素内容区(content area)的宽度. 2. 如果box-szing属性设置为border-box,width表示border area的宽度,如下图 min-width ...
- https://localhost:1158/em运行不正常
1.页面无法打开 一般是由于网站安全问题直接挂掉,可以更换浏览器,如Google Chrome.Fire Fox等.不建议使用IE Google浏览器使用如下, 直接继续 接着以用户sys,密码cha ...
- python 获取subprocess进程执行后返回值
test.py #coding=utf- import subprocess compilePopen = subprocess.Popen('gcc haha',shell=True,stderr= ...
- sublime text 3 显示空格和Tab
tab对于需要 共享 的代码而言是灾难. pyhton对这点的明确要求是不要混合使用4个空格和tab键. 只使用二者之一,都是没有问题的.如果一个python代码已经完成的部分,都是使用的4个空格.那 ...
- MVC 深入讲解Routing _路由规则【八】
一.客户端=>控制器 在项目中我们引用了system.web.routing, 如果第一个匹配成功了,那么后面的都不会再匹配. 1. routing的作用: 确定colltroller,确定ac ...
- C语言获取Linux系统精确时间
gettimeofday()函数的使用方法 1.函数原型 #include <sys/time.h> int gettimeofday(struct timeval *tv, struct ...
- (16)线程---定时器Timer
# ### 定时器:指定时间执行任务 from threading import Timer def func(): print("目前正在执行任务") t = Timer(5,f ...
- 机器学习 之梯度提升树GBDT
目录 1.基本知识点简介 2.梯度提升树GBDT算法 2.1 思路和原理 2.2 梯度代替残差建立CART回归树 1.基本知识点简介 在集成学习的Boosting提升算法中,有两大家族:第一是AdaB ...