I have a list of elements in my page which are ordered with tabindex. What I am looking for is how can I emulate that the tab key was pressed so the focus to move on the next element? I am planning to change focus on my elements in a specific time interval i.e. 1sec by using jquery.
Asked
Active
Viewed 543 times
2 Answers
1
Try this:
$('a[href="#your_tab"]').trigger('click')
Edit:
I see you are trying to simulate TAB
keypress not click
mouseclick. This will help you I think: Simulating a tab keypress using JavaScript
1
You could use Ropstah example but trigger the keypress event http://api.jquery.com/trigger/. You can specify which keycode you want "pressed"

Alistair Laing
- 983
- 1
- 7
- 18