我希望当按下 TAB 键来执行我的代码和e.preventDefault();. 为了测试,我只检查了以下事件alert(9);:
$().ready(function(){
$("div").delegate(".note","keydown",function(e){
//not working
});
$("div").delegate(".note","keypress",function(e){
//not working
});
$("div").delegate(".note","click",function(e){
//working fine
});
});
只有单击事件有效,而 keypress 和 keydown 无效。