欢迎光临
我们一直在努力

键盘和鼠标事件测试-PHP教程,PHP应用

建站超值云服务器,限时71元/月

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 键盘和鼠标事件测试-PHP教程,PHP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章