<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" onclick="add('html<br>')">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript">
function add(sTxt){
var oDIV = document.getElementById("innerContent");
oDIV.innerHTML += sTxt;
}
</script>
</head>
<body onclick="add('body<br>')">
<div onclick="add('div<br>')">
<p onclick="add('p<br>')">Click me</p>
</div>
<div id="innerContent"></div>
</body>
</html>
输出的结果在火狐和IE中html单击事件执行的顺序有差异,所以应尽量避免这种情况。