<html>
<head>
<title>键盘和鼠标事件测试</title>
<script language="javascript">
<!–
function keydown(e) {
s = "";
for(v in event)
s += v+"="+event[v]+"<br>";
view.innerhtml = s;
return false;
}
document.onkeydown=keydown
document.onkeyup=keydown
document.onmousedown=keydown
document.onmouseup=keydown
document.onmousemove=keydown
document.onmouseover=keydown
document.onmouseout=keydown
document.onkeypress=keydown
//–>
</script>
</head>
<body>
<p>请操作鼠标或键盘</p> <input type=text>
<table border>
<tr><td>123</td></tr>
</table>
<table border>
<tr>
<td colspan=3 id="keyview"> </td>
</tr>
<tr>
<tr>
<td onclick="key(this)" style="cursor=hand;">7</td>
<td onclick="key(this)" style="cursor=hand;">8</td>
<td onclick="key(this)" style="cursor=hand;">9</td>
</tr>
<tr>
<td onclick="key(this)" style="cursor=hand;">4</td>
<td onclick="key(this)" style="cursor=hand;">5</td>
<td onclick="key(this)" style="cursor=hand;">6</td>
</tr>
<tr>
<td onclick="key(this)" style="cursor=hand;">1</td>
<td onclick="key(this)" style="cursor=hand;">2</td>
<td onclick="key(this)" style="cursor=hand;">3</td>
</tr>
<tr>
<td colspan=2 onclick="key(this)" style="cursor=hand;">0</td>
<td onclick="key(this)"> </td>
</tr>
</table>
<span id="view"></span>
</body>
</html>
