HTML5 TabIndex Attribute

Posted By : Hema Chauhan | 28-Sep-2017

About

The tabIndex premises sets or returns the data of the tabindex Ascribe of an component. The tabindex Ascribe identify the tab direction of an elemen Tab index is an html Ascribe ( as well as a premises of DOM) The main focus of the HTML tabindex Ascribe is to specify a number which indicates the direction according to which a position gets focus when the user tabs through the page. It identify the position of the current component in the tabbing direction for the current document Its data must be a number between 0 and 3276.

 

What it does? It basically does two things :

 

1.) It identify the direction in which focusable field, will receive focus when navigated by the user via the keyboard (i.e on pressing tab key) field, that may receive focus are navigated ( or focussed ) according to the following rules.

 

A.) field, with positive tabindex data are navigated ( or focussed ) first and the navigation (focussing ) proceeds from the component with lowest positive tabindex to the component with highest positive tabindex. datas need not be sequential and can have any particular data field, that have identical tabindex datas are navigated (focussed ) in the direction they appear in the DOM.

 

B.) After we are done navigating through all the field, with positive tab index data the field, with tabindex data of 0 are navigated ( focussed ) next.These field, with tabindex of 0 are navigated in the direction they appear in the character stream ( or the direction in which they appear in the DOM ) Default data of all focusable field, is 0 ( input, select, a , textarea and button, area,body and Iframe).

 

C.)ield, that are disabled do not participate in the tabbing direction ( i.e they are not focused).

 

D.field, that have negative tabindex data are not part of the navigation ( or tabbing direction ) field, with tab index data of -1 can be focussed programmatically i.e component.focus().

 

2.)In html 5, any component can be made focusable by assigning a tabindex ( positive data or 0).

 

A.)field, which are not focusable by default such Div, section, h1 , h2 etc can be made focusable by assigning them a tabindex data 0 or some positive data.

 

B.)If we assign them the tab index data 0, they wil be placed in the normal tabbing direction of document.

 

C.)if we assign them a positive tab index data, they will be focused as discussed above in point 1 Tabindex as a premises Tab index is also a DOM premises which can set or returns tab direction or current component.

 

Syntax Ascribe Setting tabIndex premises

 

htmlcomponentobject.tabindex = number Getting tabIndex premises of an component HTMLcomponentObject.tabIndex.

 

Thanks

About Author

Author Image
Hema Chauhan

Hema is a bright UI designer, having knowledge of core php, HTML, CSS. Her hobbies are interacting with people, listening to music and dancing.

Request for Proposal

Name is required

Comment is required

Sending message..