Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explicitly exclude an html element from the tab order

Is there anyway to exclude an element from the tab order of a HTML form.

So if i have the following

<input type=text name=username> <input type=text name=password> <input type=button name=forgotpassword> <input type=submit name=login> 

I'm aware that I can use tabindex as 1,2,3,4 but i don't want to have to number all the fields. My application is dynamically creating the fields.

Thanks

Jason

like image 602
Jason Avatar asked Oct 09 '10 04:10

Jason


People also ask

How do you control tab order in HTML?

Use the tabindex attribute in HTML to set the tab order of an element. It gives you the authority to change the order of your TAB usage on the keyboard.

How do you make something not Tabbable in HTML?

Just add the attribute disabled to the element (or use jQuery to do it for you). Disabled prevents the input from being focused or selected at all.

How do I change my Tabindex order?

The only way to change this order is to reorder your HTML elements. tabindex itself can do 2 things: it sets the order of "focusable" elements. it makes element "focusable".


1 Answers

Setting the tabindex to -1 will render an element untabbable (if that's a word) :)

<input type="text" name="username" tabindex="-1" /> 
like image 198
Marko Avatar answered Sep 22 '22 07:09

Marko