转自:http://www.zhuoda.org/lunzi/104118.html
<!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>js捕捉回车事件</title>

<script>
function test(){
if (event.keyCode == 13)    {
         alert(
"捕捉住回车提交事件!");
     }
}
</script>


</head>

<body>

<form method=
"post">
标题:<input type=
"text" name="t" onkeydown="test();"/>
</form>

</body>
</html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-07-03
  • 2021-08-04
  • 2021-07-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-12
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案