好的,我已经让热键生效了,但是无法让它停止
$(document).keypress(function(e){
if(e.which == 13){
//Enter key is press do what you want
}
else if(e.which == 67 || e.which == 99){
//C key is press do what you want
window.location.href = "/html/credits.php";
}
else if(e.which == 32){
alert("Space pressed");
}
});
$("input.registerform").keypress(function(e){
e.stopPropagation(); });
这是我要停止它的方法,我的输入表单类名是“registerform bgcolor2”,但无论是“input.registerform”还是“input.registerform bgcolor2”都不起作用。我尝试将其添加为ID,使用“registerform”作为ID也不起作用:/
这是由AJAX引起的吗?还是我漏掉了什么?
(抱歉我重新发布了这个问题,只是创建了一个新帐户,找不到我的旧问题> . <)