87,915
社区成员
发帖
与我相关
我的任务
分享
TextBox1.value=TextBox1.value + " " + String.fromCharCode(event.keyCode);
<input type="text" id="txt" />
<script>
document.onkeypress = function (e) {
e = e || window.event;
txt.value += ' ' + String.fromCharCode(e.keyCode || e.which);
}
</script>