美文网首页
ie 8 input 事件兼容

ie 8 input 事件兼容

作者: A_dfa4 | 来源:发表于2020-12-28 19:54 被阅读0次
    <div>
      <textarea name="" id="" cols="30" rows="10"></textarea>
    </div>
    
    <script src="./jquery/jquery.min.js"></script>
    <script>
      $(function () {
        $("body").on("input propertychange", "textarea", function () {
          console.log(888);
        }); // 不支持on注册??? 我试的没有效果不确定
        //propertychange
        $('textarea').bind('input', function() {
          console.log($(this).val());
        }); // 在ie不行
        $('textarea').bind('input propertychange', function() {
          console.log($(this).val());
        }); // 在ie可以
      }) 
    </script>
    

    做一个政府项目, 兼容ie8 - -, 选择了layui框架,在多选时选择了 form-select4插件,客户说需要搜索在 谷歌好好的 在ie 挂了..... 原因是ie8 不兼容input事件???(在源码320行左右),ie的propertychange好像不行on 注册 偷懒直接加了个 keyup事件 - -...

    借鉴地址:https://www.cnblogs.com/lhb25/archive/2012/11/30/oninput-and-onpropertychange-event-for-input.html

    相关文章

      网友评论

          本文标题:ie 8 input 事件兼容

          本文链接:https://www.haomeiwen.com/subject/jmbtoktx.html