转载: js按回车键实现登陆
转载网址:http://blog.csdn.net/mawenwu281107072139/article/details/4787258
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head>
- <title>Check Score</title>
- <mce:script language="JavaScript"><!--
- function keyLogin(){
- if (event.keyCode==13) //回车键的键值为13
- document.getElementById("input1").click(); //调用登录按钮的登录事件
- }
- // --></mce:script>
- </head>
- <body onkeydown="keyLogin();">
- <input type="text" />
- <input type="text" />
- <input type="text" /><input type="text" />
- <input type="text" /><input type="text" />
- <!--<input id="input1" value="登录" type="button" onclick="alert('调用成功!')">-->
- <img id="input1" onclick="alert('调用成功!')"/>
- </body>
- </html>