JavaScript outer click
You can find some source code under the cut.
<html>
<head>
<style>
body {
background : #00ff00;
}
#btn {
border : 1px solid #000000;
margin-top : 100px;
background : #cccccc;
text-align : center;
cursor : pointer;
}
</style>
</head>
<body>
<div id="btn">CLICK ME</div>
</body>
<script>
document.onclick = function(e) {
e = e || window.event;
if (!e.target) {
e.target = e.srcElement;
}
alert("btn" == e.target.id ? "inner" : "outer");
}
</script>
</html>
June 3rd, 2011