Js text box input point carriage return trigger to ensure compatibility with IE FF etc

  • 2020-03-29 23:50:28
  • OfStack

 
<head> 
<script> 
function EnterPress(e){ //In the event
var e = e || window.event; 
if(e.keyCode == 13){ 
document.getElementById("txtB").focus(); 
} 
} 
</script> 
</head> 
<body> 
<input type="text" id="txtA" onkeypress="EnterPress(event)" onkeydown="EnterPress()" /> 
<input type="text" id="txtB" /> 
</body> 

Related articles: