案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
4
<script type="text/javascript">
5
function getEventTrigger(event)
6
  { 
7
  x=event.currentTarget; 
8
  alert("The id of the triggered element: "
9
   + x.id);
10
  }
11
</script>
12
</head>
13
14
<body >
15
16
<p id="p1" onmousedown="getEventTrigger(event)">
17
Click on this paragraph. An alert box will
18
show which element triggered the event.</p>
19
20
</body>
21
</html>
22