网页中经常会有提交表单,按回车执行登录或者注册,比较方便
HTML:
<input class=”btn_l” type=”image” alt=”登录” src=”img/login.gif” onclick=”login();” onKeyDown=”ctlent()”>
JS:
function ctlent(eventobject){
if((event.ctrlKey&&window.event.keyCode==13)||window.event.keyCode==13)
{login();return false;}
else{return true;}}
</script>
如果你读了我的文章,觉得有帮助:
说明
发表评论



暂时没有评论!