用srcElement试试
<script>
function showid()
{
alert(event.srcElement.id);
}
document.onclick=showid;
</script>
<body id=mybody>
<form name=form1 action=myasp.asp>
<table id=mytable><tr id=mytr><td id=mytd>123</td></tr></table>
<input id=mytext>
<input id=mybutton type=button>
</form>
</body>
<script>
function showid()
{
alert(event.srcElement.id);
}
document.onclick=showid;
</script>
<body id=mybody>
<form name=form1 action=myasp.asp>
<table id=mytable><tr id=mytr><td id=mytd>123</td></tr></table>
<input id=mytext>
<input id=mybutton type=button>
</form>
</body>
<div style="width:200;height:200;background-color:red"></div>
</body>