有什么问题请到<a href='/bbs/forums.php?fid=21'>论坛</a>中发表<br>
<!--# 特效来源:http://www.webjx.com/js -->
<!-- 把下列代码加到<body>区域中 -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function showKeyCode()
{
var character = document.characterCode.character.value.substring(0,1);
var code = document.characterCode.character.value.charCodeAt(0);
var msg = "这个字母"+character+"的ASCII码是:"+code+".";
alert(msg);
}
// End -->
</script>
<form name="characterCode">
<center>请输入一个字母:
<input type="text" name="character" size="15">
<input type="button" value="看一下键值" onClick="showKeyCode();">
</center>
</form>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]