tabIndex attribute
Specifies the tabbing order for keyboard navigation using the TAB key.
The default tabbing order matches the source order in the markup, with tabIndex you can change this order. The browser will tab to the elements in ascending order.
The another effect of the tabIndex attribute is that if it is specififed, the element can be active (can have focus). Most of the HTML elements cannot be active by default (div, span, ...), but if the tabIndex attribute is set on them, they can be active.
JavaScript page for this attribute: tabIndex. You can find other example(s) there. |
Possible values:
Integer that sets the position of the element in the tabbing hierarchy. Default: 0. If the value is a negative number, the element will be removed from the tabbing hierarchy.
Default: 0.
Example HTML code 1:
This example illustrates the use of the tabIndex attribute:
|
||||
<input type="text" tabindex="1" value="Use the" /> <input type="text" value="TAB key" /> <input type="text" tabindex="2" value="to navigate" /> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
a, abbr, acronym, address, applet, area, b, bdo, big, blink, blockQuote, body, br, button, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, embed, fieldSet, font, form, frame, frameSet, H1, H2, H3, H4, H5, H6, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:range, input:reset, input:search, input:submit, input:text, ins, isIndex, kbd, keygen, label, legend, li, listing, map, marquee, menu, nobr, noFrames, object, ol, optGroup, option, p, plainText, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tBody, td, textArea, tFoot, th, tHead, tr, tt, u, ul, var, wbr, xmp
External links:
User Contributed Comments