我只是想禁用Enter键盘上的键.由于某些原因,以下脚本会锁定整个键盘,但仍然只允许使用该Enter键.
如果这有助于查明遗漏或错误,我使用的是VS 2005,VB.NET 2.0和IE 7.
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<script language="JavaScript">
function TriggeredKey(e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
if (window.event.keyCode = 13 ) return false;
}
</script>
</head>
<body onkeydown="TriggeredKey(this)">
Run Code Online (Sandbox Code Playgroud) javascript ×1