複製代碼代碼如下:
<! Doctype HTML公共“ - // W3C // DTD XHTML 1.0 Transitional // en”“” http://www.org/tr/tr/xhtml1/dtd/xhtml1-xhtml1-transitional.transitional.dtdd'>
<html xmlns =“ http://www.w3.org/1999/xhtml”>
<頭>
<meta http-equiv =“ content-type” content =“ text /html; charset = utf-8” />
<Title> JS </Title>
<script type =“ text/javascript” language =“ javaScript”>
功能chang(){
var evt =事件|| window.event;
警報(evt.srcelement.id);
}
</script>
</head>
<div>
<輸入type =“ text” onclick =“ chang();” id =“ input_a” />
<輸入type =“ text” onclick =“ chang();” id =“ input_b” />
</div>
<身體>
</body>
</html>