Reputation: 57
I have 4 text fields. When i enter a value in first text box cursor should move to next text box. That is onkeyup() i need to perform action of tab key. Is there any javascript or jquery for that
Upvotes: 0
Views: 149
Reputation: 314
You can try this
HTML
<input type="text" class="focus" />
<input type="text" class="focus" />
<input type="text" class="focus" />
<input type="text" class="focus" />
JS
$(".focus").keyup(function(){
if($(this).val() != "")
{
$(this).next(".focus").focus();
}
});
Upvotes: 1