码迷,mamicode.com
首页 > Web开发 > 详细

JS判断input按了回车键

时间:2016-06-02 16:34:47      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:

参考代码如下:

<input type="textbox" id="textbox1" onkeypress="CheckInfo" />

 

function CheckInfo() {
    if (event.keyCode == 13) {
        alert(textbox1.text);
    }
}

 

JS判断input按了回车键

标签:

原文地址:http://www.cnblogs.com/3box/p/5553254.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!