复制代码代码如下::
<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" />
<title> js 函数中获取事件源 </title>
<script type = "text/javaScript" Sprache = "JavaScript">
Funktion Chang () {
var evt = Ereignis || Fenster.Event;
alert (evt.srcelement.id);
}
</script>
</head>
<div>
<Eingabe type = "text" onclick = "Chang ();" id = "input_a" />
<Eingabe type = "text" onclick = "Chang ();" id = "input_b" />
</div>
<body>
</body>
</html>