新版本的Edge浏览器不支持原IE自带的onpropertychange方法,须要使用oninput方法,而oninput方法在Edge中又没法使用bind和on绑定function。所以须要特殊处理才能使用oninput方法浏览器
Element.prototype.addEvent = function(type,fn){this
if(window.addEventListener){});spa
为了使IE9-IE十一、以及谷歌所有支持,能够给他绑定两个方法。prototype
document.getElementById('test1')['oninput']=function(){
alert("兼容谷歌和Edge");
get
}input
$("#test1").bind("propertychange",function (){
it
alert("兼容IE");io
}function