zoukankan      html  css  js  c++  java
  • js input监听兼容事件

    $('#phoneNumber').on('input',function() {
    var valueP = $(this).attr('value');
    if(valueP.length == 11){
    $('#getVerCode').removeClass('unclick');
    $('.getVerCodeJ').css('display','none');
    }
    else{
    $('#getVerCode').addClass('unclick');
    $('.getVerCodeJ').css('display','block');
    }
    });

    //for ie
    if(document.all){
    $('#phoneNumber').each(function() {
    var that=this;

    if(this.attachEvent) {
    this.attachEvent('onpropertychange',function(e) {
    if(e.propertyName!='value') return;
    $(that).trigger('input');

    var valueP = $(this).attr('value');
    if(valueP.length == 11){
    $('#getVerCode').removeClass('unclick');
    $('.getVerCodeJ').css('display','none');
    }
    else{
    $('#getVerCode').addClass('unclick');
    $('.getVerCodeJ').css('display','block');
    }
    });
    }
    })
    }
  • 相关阅读:
    列表、元组、字符串的相互转化
    python中的常用BIF
    python中的类型
    python内置模块
    打印字体颜色整理
    xml操作
    内置函数
    迭代器
    装饰器
    函数
  • 原文地址:https://www.cnblogs.com/wangqiao170/p/6740255.html
Copyright © 2011-2022 走看看