Jquery的bind("input")事件封装,兼容ie8,9

时间:2023-02-05 17:58:39

 

使用方法

<body>  
  
Input: <input type="text" id="input"><br>  
<textarea id="log" readonly></textarea>  
  
<script src="jquery.min.js"></script>  
<script src="jquery.splendid.textchange.js"></script>  
<script>  
$("#input").on("textchange", function() {  
  //do something...
var value = this.value; $("#log").val(function(i, oldLog) { return oldLog + "textchange, value: " + value + "\n"; }); }); </script> </body>

附上插件链接