展开全部
<body>
<form name="form1">
<input type="text" name="text1" onkeydown="fun1();">
<input type="text" name="text2" onkeydown="fun2();">
<input type="button" onclick="fun()" value="submit">
</form>
</body>
</html>
<script language="javascript">
function fun1()
{
if(window.event.keyCode == 13)
form1.text2.focus();
}
function fun2()
{
if(window.event.keyCode == 13)
fun();
}
function fun()
{
form1.submit();
}
</script>
</body>
<form name="form1">
<input type="text" name="text1" onkeydown="fun1();">
<input type="text" name="text2" onkeydown="fun2();">
<input type="button" onclick="fun()" value="submit">
</form>
</body>
</html>
<script language="javascript">
function fun1()
{
if(window.event.keyCode == 13)
form1.text2.focus();
}
function fun2()
{
if(window.event.keyCode == 13)
fun();
}
function fun()
{
form1.submit();
}
</script>
</body>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询