鍵盤和鼠標事件測試

發表于:2007-07-14來源:作者:點擊數: 標簽:
HTML HEAD TITLE鍵盤和鼠標事件 測試 /TITLE script language= java script !-- 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.o
<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>

原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97