我的代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title> New Document </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>
$(function(){
document.getElementById("test").onpropertychange=function(){
alert("test");
};
$("#test").bind("propertychange",function(){
alert("abc");
});
});
</script>
</head>
<body>
<input id="test"></input>
</body>
</html>
结果只弹出了test,没有弹出abc,有朋友知道是什么原因不?
ie 系列 :ie9 支持 oninput ,ie9 以下支持 onpropertychange (你可以通过ie的模式选择来测试)
chrome,firefox 支持 oninput
建议两个都绑定!
谢谢,我改为:
$("#test").bind("input propertychange",function(){
alert("abc");
});
这样可以了。一直以为IE9也支持 propertychange
不错
@artwl: 赞一个,我也遇到这个问题
在ie下,剪切无效的?粘贴可行