87,910
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function handleEvent(oEvent)
{
// oEvent=window.event;
var oTextbox=document.getElementById("txt1");
oTextbox.value+="\n"+oEvent.type;
oTextbox.value+="\n target is "+(oEvent.target||oEvent.srcElement);
oTextbox.value+="\n keyCode is "+oEvent.keyCode;
oTextbox.value+="\n charCode is "+oEvent.charCode;
}
</script>
</head>
<body>
<textarea id="txtInput" rows="15" cols="50"
onkeydown="handleEvent(event)"
onkeyup="handleEvent(event)"
onkeypress="handleEvent(event)"></textarea>
<textarea id="txt1" rows="15" cols="50"></textarea>
</body>
</html>