I have a some text boxes in my form. I don't know their id
values. I want change the cursor position from the existing one to the next field by pressing Enter.
Pay attention that the cursor may be in different positions at the first time.
What is your suggestion?
you didn't provide your markup so I can't make assumption about your structure (e.g. using
.next()
if they are sibling elements). So, supposing you haveinput
text, try this example (for jQuery 1.7+)When you press enter on last input, the first input will be focused (in a loop). See a jsfiddle example: http://jsfiddle.net/8ruDV/