表单元素input事件兼容解决方案

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wlx1991/article/details/50628705
var inputEvent = 'oninput' in document.createElement('input') ? 'input' : 'propertychange';
$('input').on(inputEvent, function(e){
  console.log('input event', e);
});

猜你喜欢

转载自blog.csdn.net/wlx1991/article/details/50628705
今日推荐