美文网首页
jquery监听回车事件

jquery监听回车事件

作者: 佛系码农 | 来源:发表于2018-06-29 18:41 被阅读0次

    $("#template_name").unbind("keypress").bind("keypress",//需要监听的元素绑定键盘输入事件
    function(event) {
    if (event.keyCode === 13) { //keyCode=13为回车键
    //other code

        }
    });
    

    相关文章

      网友评论

          本文标题:jquery监听回车事件

          本文链接:https://www.haomeiwen.com/subject/xptzyftx.html