标签:
JS监听某个输入框
1
2
3
4
5
6
7
|
//回车事件绑定 $( ‘#search_input‘ ).bind( ‘keyup‘ , function (event) { if (event.keyCode == "13" ) { //回车执行查询 $( ‘#search_button‘ ).click(); } }); |
JS监听某个DIV区域
1
2
3
4
5
6
7
8
9
|
$( "#queryTable" ).bind( "keydown" , function (e){ // 兼容FF和IE和Opera var theEvent = e || window.event; var code = theEvent.keyCode || theEvent.which || theEvent.charCode; if (code == 13) { //回车执行查询 $( "#queryButton" ).click(); } }); |
标签:
原文地址:http://www.cnblogs.com/archoncap/p/5087558.html