打印

键盘和鼠标事件测试

键盘和鼠标事件测试

<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>

TOP

当前时区 GMT-4, 现在时间是 2008-12-3 21:25
ComePlay8.Com
Powered by Discuz! 6.0.0 © 2001-2007 Comsenz Inc.
Processed in 0.052914 second(s), 10 queries, Gzip enabled
TOP
清除 Cookies - 联系我们 - 来玩吧 - Archiver - WAP
Designed By Discuz! Support Team