<
html
>
< head >
< title > 儒通软件测试 </ title >
< script language ="javascript" type ="text/javascript" >
function enterkey()
{
try
{
var el_keydown = window.event.srcElement;
if (event.keyCode == 13 && el_keydown.id == " txt1 " )
{
txt2.focus();
}
else if (event.keyCode == 13 && el_keydown.id == " txt2 " )
{
btn.focus();
}
}
catch (e)
{
return ;
}
}
</ script >
</ head >
< body >
< input type ="text" id ="txt1" onkeydown ="enterkey();" />< br />
< input type ="text" id ="txt2" onkeydown ="enterkey();" />< br />
< input type ="button" id ="btn" value ="button" onclick ="alert(txt2.value)" >
</ body >
</ html >
< head >
< title > 儒通软件测试 </ title >
< script language ="javascript" type ="text/javascript" >
function enterkey()
{
try
{
var el_keydown = window.event.srcElement;
if (event.keyCode == 13 && el_keydown.id == " txt1 " )
{
txt2.focus();
}
else if (event.keyCode == 13 && el_keydown.id == " txt2 " )
{
btn.focus();
}
}
catch (e)
{
return ;
}
}
</ script >
</ head >
< body >
< input type ="text" id ="txt1" onkeydown ="enterkey();" />< br />
< input type ="text" id ="txt2" onkeydown ="enterkey();" />< br />
< input type ="button" id ="btn" value ="button" onclick ="alert(txt2.value)" >
</ body >
</ html >
仅限IE