<input type="text" id="inp" placeholder="请输入" />
$(function(){
$('#inp').on('keypress',function(event){
if(event.keyCode=='13'){
alert('OK');
}
})
})
jQuery 给input框绑定回车键
最新推荐文章于 2024-04-10 17:13:41 发布
<input type="text" id="inp" placeholder="请输入" />
$(function(){
$('#inp').on('keypress',function(event){
if(event.keyCode=='13'){
alert('OK');
}
})
})