========================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>阿当制作</title>
</head>
<body>
<input type="button" value="不阻止冒泡的按钮" id="btn" />
<input type="button" value="阻止冒泡的按钮" id="btn2" />
</body>
<script type="text/javascript">
document.onclick = function(){
alert("我是body");
}
document.getElementById("btn").onclick=function(e){
alert("我是按钮");
}
document.getElementById("btn2").onclick=function(e){
alert("我是按钮");
if(document.all) window.event.cancelBubble=true;
else e.stopPropagation();
}
</script>
</html>