复制代码代码如下:
<! DocType html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transicional.dtd ">
<html xmlns = "http://www.w3.org/1999/xhtml">
<Evista>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> js 函数中获取事件源 </title>
<script type = "text/javaScript" lenguaje = "javaScript">
function chang () {
var evt = evento || Window.event;
alerta (evt.srcelement.id);
}
</script>
</ablo>
<div>
<input type = "text" onClick = "chang ();" id = "input_a" />
<input type = "text" onClick = "chang ();" id = "input_b" />
</div>
<Body>
</body>
</html>