jquery绑定解绑事件,带event

 var limitUnit = $("#limitUnit_0").val();
 
 $("[name='limitAmount']").each(function(){
  $(this).val("");
  $(this).attr("onkeydown","");
  if(limitUnit=="1"){
    $(this).unbind("keydown");
    $(this).bind("keydown",function(event){return checkNumber(event);});
  }else if(limitUnit=="2"){
    $(this).unbind("keydown");
    $(this).bind("keydown",function(event){return checkMoney(event,2);});
  }
 }); 

你可能感兴趣的:(jquery)