<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

相关文章:

  • 2021-12-16
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-03
  • 2021-09-13
  • 2021-11-18
  • 2021-11-19
  • 2022-12-23
  • 2022-01-21
相关资源
相似解决方案