1、在div里面設置
<script type="text/JavaScript">
function aa(e){alert("inputting!!");}
</script>
<input type="text" id="a" oninput="aa(event)" onporpertychange="aa(event)" />
2滩援、使用原生js添加監(jiān)聽事件
<script type="text/javascript">
$(function(){
if("\v"=="v"){//true為IE瀏覽器,感興趣的同學可以去搜下租悄,據(jù)說是現(xiàn)有最流行的判斷瀏覽器的方法
document.getElementById("a").attachEvent("onporpertychange",function(e){
console.log("inputting!!");
}
}else{
document.getElementById("a").addEventListener("onporpertychange",function(e){
console.log("inputting!!");
}
}
});
</script>
<input type="text" id="a"/>