版权声明:所有原创文章未经本人同意不得随意转载,谢谢 https://blog.csdn.net/tangcc110/article/details/88218347
jQuery3.0 写法: $('#input').on('input propertychange', function(e) { e.stopPropagation(); // $('#content').html($(this).val().length + ' characters'); $("#hint_li").addClass("active-visible"); });
js 兼容写法(input同时监听以下两个事件):
oninput(IE9+、现代浏览器) & onpropertychange(IE9以下)