多个事件触发同一反应

$("#redrow").on("click touchend",function(){});//每个监听事件之间用 “空格” 隔开



多个事件触发不同反应
$(".serverinfo").bind("keyup",function() {
    $(this).val($(this).val().replace(/[^0-9.]/g,''));
}).bind("click",function(){
    $(this).select();
    $(this).removeClass("text-danger");
}).bind("paste",function(){
    $(this).val($(this).val().replace(/[^0-9.]/g,''));
}).bind("blur",function(){
    var reg=/^(([01]?[\d]{1,2})|(2[0-4][\d])|(25[0-5]))(\.(([01]?[\d]{1,2})|(2[0-4][\d])|(25[0-5]))){3}$/;
    if(!reg.test($(this).val())){
        //不满足类IP形式
        $(this).next().removeClass("hidden");
    }else{
        //满足类IP形式
        $(this).next().addClass("hidden");
    }
}).css("ime-mode","disabled");

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-12-20
  • 2021-07-24
猜你喜欢
  • 2021-11-04
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2022-02-24
相关资源
相似解决方案