事件触发顺序:
compositionstart->input->compositionend->keyup
IOS上 输入中文时 onkeyup无法触发

 

 

if(navigator.userAgent.indexOf('Android') > -1){
                   $("#sign").on("input", function(){
                       //console.log(this.value);
                       $(".num").html(self.globalNum - this.value.length);
                   });
               }else{
                   $("#sign").on("keyup compositionend", function(){
                       //console.log(this.value);
                       $(".num").html(self.globalNum - this.value.length);
                   });
               }

 

相关文章:

  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-03-01
相关资源
相似解决方案