IOS中input键盘事件支持的解决方法

欢迎大家去我的网站详细查看http://genghongshuo.com.cn/
IOS中input键盘事件keyup、keydown、等支持不是很好, 用input监听键盘keyup事件,在安卓手机浏览器中没有问题,但是在ios手机浏览器中用输入法输入之后,并未立刻相应keyup事件

可以用html5的oninput事件去代替keyup

<input type="text" id="inputId">
<script type="text/javascript">
  document.getElementById('inputId').addEventListener('input', function(e){
    var value = e.target.value;
  });

猜你喜欢

转载自www.cnblogs.com/hsgeng/p/9146557.html
今日推荐