<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>ASCII键值查询</title>

<script language="javascript"> 
ie4 = (document.all) ? true : false; 
ns4 = (document.layers) ? true : false; 
function keyDown(e){
if (ns4){
    var nKey=e.which;
    document.keyform.keytext.value="nKey:"+ nKey;
    //document.keyform.keytext.value="nKey:";
    }
if (ie4){
    var ieKey=event.keyCode;
    document.keyform.keytext.value="您查询的键值为:"+ieKey;
    //document.keyform.keytext.value="ieKey:";
    }
}
document.onkeydown=keyDown;
if (ns4)  {document.captureEvents(Event.KEYDOWN);
}
</script>
 
</head>

<body>

<table border="0" width="100%">
    <tr>
        <td>
        <p align="center">ASCII键值查询
        </td>
    </tr>
    <tr>
        <td>
        <p align="center">请按下您键盘上的任意键,所对应的ASCII码会显示在下面的文本框内</tr>
    <tr><form name="keyform" >
        <td>
        <p align="center"><input type="text" name="keytext" size="30"></form></td>
    </tr>
</table>
</body>
</html>

相关文章:

  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2021-04-19
猜你喜欢
  • 2021-05-26
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2021-12-05
相关资源
相似解决方案