标签:
<input id="ipt" type="text" /> <script type="text/javascript"> function addEvent(el,type,fn){ if(el.addEventListener){ el.addEventListener(type, fn, false); }else{ el.attachEvent(‘on‘ + type, fn); } } var ipt = document.getElementById(‘ipt‘); addEvent(ipt,‘textInput‘,function(e){ e = e || window.event; console.log(e.data); }); </script>
标签:
原文地址:http://www.cnblogs.com/heqhbk/p/4250407.html