标签:query ie9 element code 取值 浏览器 else div ble
oninput ie9+,other
onpropertychange ie6-8
js使用
var el = docuemnt.getElementById(‘id‘); if(‘oninput‘ in el){ el.addEventListener(‘input‘,fn,false); } else{ el.onpropertychange = fn; }
jquery中注册事件
$el.on(‘input propertychange‘,fn)
oninput限制:1. js改变value时,不触发 2.select选取值,不触发
onpropertychange限制:input为disable=true时,不触发
keyup,keydown,keypress等事件,对粘贴的内容无效,在某些版本的浏览器中也会失效
onchange只在失焦时,且内容发生改变时触发
标签:query ie9 element code 取值 浏览器 else div ble
原文地址:http://www.cnblogs.com/mengff/p/6077523.html