$("#template_name").unbind("keypress").bind("keypress",//需要监听的元素绑定键盘输入事件
function(event) {
if (event.keyCode === 13) { //keyCode=13为回车键
//other code
}
});
$("#template_name").unbind("keypress").bind("keypress",//需要监听的元素绑定键盘输入事件
function(event) {
if (event.keyCode === 13) { //keyCode=13为回车键
//other code
}
});
本文标题:jquery监听回车事件
本文链接:https://www.haomeiwen.com/subject/xptzyftx.html
网友评论