blob: c31698aa0444bc75276c1f1529254eb816001b48 [file] [log] [blame]
<html>
<head>
<style>
#target {
background-color:purple;
width:25px;
height:25px;
}
</style>
<script>
function clicked(e) {
var result = parent.document.getElementById("result");
result.innerHTML = "Pass!";
e.stopPropagation();
}
function bodyClicked() {
var result = parent.document.getElementById("result");
result.innerHTML = "Failed! Hit the body.";
}
window.onload = function () {
document.getElementById("target").addEventListener("click", clicked);
document.body.addEventListener("click", bodyClicked);
}
</script>
</head>
<body>
<div id="target"></div>
</body>
</html>