Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: How to capture tab key?
03-09-2005, 06:08 PM #1
- Join Date
- Aug 2004
- Thanked 0 Times in 0 Posts
How to capture tab key?
I tried to capture document.onkeypress and check the target element if it is a child of our div. If the event target is a child element of our div, then continue navigation otherwise ignore tab key and set focus to the first element of the div.
But there is a small problem. when the user is on the last element of our div, then also our condition will be true and the navigation will leave the div to the next element of the document(which I dont want) and if the user presses tab again it will come back to the first element of our div.
If anybody knows how to get out of this, it will be great....
Thanking you in advance...