Hi guys I\'m learning Javascript and I would like to ask you guys how can I go to the next textbox after inputing text when I press the enter button in the keyboard. thank y
Try this code :
$('#inputform').on('keydown', 'input', function (event) { if (event.which == 13) { event.preventDefault(); var $this = $(event.target); var index = parseFloat($this.attr('data-index')); $('[data-index="' + (index + 1).toString() + '"]').focus(); }
});
Help Link