input number maxlength 失效 移动端使用

   <input type="number"  oninput="checkTextLength( this , 5)"> 

function checkTextLength(obj, length) {   
   
           if(obj.value.length > length)   {   
               
               obj.value = obj.value.substr(0, length);  
           }   
  
}

文章来自:http://www.cnblogs.com/huyajie/p/4113550.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3