首页 > Web开发 > 详细

js事件行为

时间:2016-05-13 10:28:57      阅读:245      评论:0      收藏:0      [点我收藏+]
 1 div.onclick=function(e){
 2     var e=e||window.event;
 3     var target=e.target||e.srcElement;
 4     if(target.nodeName.toLowerCase()==‘input‘){
 5         alert(‘weituo!‘);
 6     }
 7     if(e.stopProgation){
 8         e.stopProgation();
 9     }else if(e.cancelBubble){
10         e.cancelBubble=true;
11     }
12 
13     if(e.preventDefault){
14         e.preventDefault();
15     }else if(e.returnValue){
16         e.returnValue=false;
17     }
18 }

 

js事件行为

原文:http://www.cnblogs.com/mk2016/p/5486562.html

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