PDA

View Full Version : Iterating tab-order of a document or form...



knave
Sep 14th, 2007, 05:36 AM
I have a series of input and button elements that i want to programmatically iterate through to set focus, and I want to do this following the existing tab ordering. That is to say, I want to be able to do the equivalent of tabbing or shift+tabbing back and forth between said elements.

Is there a cross-browser way to do this?

Fang
Sep 14th, 2007, 03:24 PM
Use tabindex (http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1).
If the input - button pairs are sequential then loop through the form elements.