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