What is TabIndex?

Source: Internet
Author: User

TabIndex is used to obtain the defined TabIndex elements in sequence by the Tab key and set the focus between each element.

People who have completed or filled out forms will find that using the Tab key can obtain the focus of each input one by one. This item can be modified, for example, not wanting to be acquired or changing the order in which it is obtained.

When filling out the form (registration login or other), many users directly press the Tab key to jump to the next text box, and wait until all the items are filled in, then submit. This is a very good and convenient function. My personal habit is that when you fill in all the items, the submit button is usually clicked with the mouse, and you do not want the Tab to jump the focus to the button, however, I rarely find that using a Tab won't jump to a button. I don't know if my personal habits are too BT -_-!!!

If you do not want to get the focus of a specific item, you can tabindex =-x to make the value of tabindex negative. In this way, the Tab will be skipped directly.

 

The following uses a simple form as an example:

<Form name = "testform" method = "post" action = "">
<Input type = "text" name = "t1" tabindex = "1"/>
<Input type = "text" name = "t2" tabindex = "2"/>
<Input type = "text" name = "t3" tabindex = "3"/>
<Input type = "submit" name = "t4" value = "SendInfo" tabindex = "-1"/>
</Form>

By using the Tab key, the order in which focus is obtained is sorted by the value size of tabindex. In the preceding example, the focus is t1, t2, t3, And to t4. Since the TabIndex value is-1, t4 does not obtain the focus, instead, it jumps directly to the next element that gets the focus.

The TabIndex values of t1, t2, t3, and t4 can be changed as needed. The Tab focus is obtained from small to large.

TabIndex is used for these drops...

From: http://www.doyoe.com/wzcg/showarticle.asp? Keyfid = expbz & id = 99

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.