Reputation: 4908
After my user enters text into a form field I want to force the cursor to jump to the next field, by doing something like
$('#senderName').focus();
This works as long as the next field is an input
element. It doesn't work when the next input is a textarea
. Is there any way to force the cursor to jump to a textarea
?
Thanks
Upvotes: 0
Views: 380
Reputation: 199
Add tabindex=1
to textarea
.
<textarea id="senderName" tabindex="1"></textarea>
Upvotes: 0
Reputation: 2828
Works for me!
Fiddle here
<textarea id="myid"></textarea>
$("#myid").focus()
Upvotes: 1