编程练习为什么要阻止事件冒泡
title.onclick=function(event){
event = event ||window.event;
// 执行脚本
if(event.stopPropagation){
event.stopPropagation();
}else{
event.cancelBubble=true;
}
menu.style.display='block';
}
title.onclick=function(event){
event = event ||window.event;
// 执行脚本
if(event.stopPropagation){
event.stopPropagation();
}else{
event.cancelBubble=true;
}
menu.style.display='block';
}
2016-08-17
举报