This is my script file. I am call my div id="AppContainer " in this script when press enter.This code is working on only chrome browser but not working in other browser.What is the problem?
HTML:
<div id="AppContainer">
<input type="text">
<input type="text">
</div>
<script type='text/javascript'>
$(document).ready(function(){
$('#AppContainer input').keydown(function(e){
if(e.keyCode==13){
if($(':input:eq(' + ($(':input').index(this) + 1) + ')').attr('type')=='submit'){// check for submit button and submit form on enter press
return true;
}
$(':input:eq(' + ($(':input').index(this) + 1) + ')').focus();
return false;
}
});
});
</script>
See Question&Answers more detail:os