document.onkeydown = function (e) { var theEvent = window.event || e; var code = theEvent.keyCode || theEvent.which; if (code == 13) { $("#login_submit").click(); } }
$(document).ready(function() { //登录提交 $("#login_submit").bind('click',function(){ var username=$("#username").val(); var password=$("#password").val();