The function keyCode
does not work in Chrome but in Firefox it works very well, pressing the Tabon the input calcular
should trigger the function.
here my code:
$("#calcular").keypress(function(event) {
var keycode = event.keyCode;
console.log(event.keyCode);
if (keycode == 9) {
$("input[name=Comentarioo]").focus();
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="calcular" value="">
I hope I have explained myself well.
To achieve what you want, you can use the method
keydown
like this: