首页 > Web开发 > 详细

jquery 监听input输入值事件

时间:2014-11-24 16:41:52      阅读:360      评论:0      收藏:0      [点我收藏+]
  1. <html>  
  2.     <head>  
  3.     <title></title>      
  4.     <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>  
  5.     </head>  
  6.     <script type="text/javascript">  
  7.         $(function(){  
  8.             //IE  
  9.             if($.browser.msie){  
  10.                   $("#sno").get(0).attachEvent("onpropertychange",function (o){  
  11.                            alert(o.srcElement.value);  
  12.                     });  
  13.             //非IE  
  14.             }else{  
  15.             $("#sno").get(0).addEventListener("input",function(o){  
  16.                     alert(o.target.value);  
  17.                 },false);  
  18.             }  
  19.     });      
  20.     </script>  
  21.     <body>  
  22.         <input id="sno" value="">      
  23.     </body>  
  24.       
  25. </html>   

jquery 监听input输入值事件

原文:http://www.cnblogs.com/fxm1314/p/4118779.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!