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
htmlcomponentobject.tabindex = number Getting tabIndex premises of an component HTMLcomponentObject.tabIndex.
Thanks
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
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.