<!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" οnkeydοwn="test();"/>
</form>
</body>
</html>
js捕捉回车事件
最新推荐文章于 2024-10-13 17:00:37 发布