The tabIndex property sets or returns the tab index for a text field. The tab order defines the order the elements appear if you navigate the page using the “tab” button on the keyboard.
Given the scenario that we have a webpage which has many links & a form for users to complete. In this case we see that the main focus is the form not the links before the form. If users were to use tabkey to browse to the form, it would take many keypress before users are able to go to form. We can solve our problem by specifying the tabindex property.
Here’s a simple example:
<pre><form>
<label for="name">Your Name</label>
<input value="" id= "name" name="name" type="text" tabindex = "1">
<label for="email">Your E-mail</label>
<input value="" name="email" id="email" type="text" tabindex = 2>
<label for="mobile">Your mobile</label>
<input value="" name="mobile" id="mobile" type="text" tabindex = -1 >
<label for="message">Message</label>
<textarea rows="4" cols="30" name="message" id="message" tabindex = 3></textarea>
</form>
</pre>
“tabindex = -1″ will make the tab not go though the field when the user clicks tabkey.
Hello from Russia!
Can I quote a post in your blog with the link to you?
Sorry for late reply since i was on holiday. Yes, you’re welcome to quote in your blog.