Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get TabIndex property of currently active control?

How do I find the TabIndex property of the control who has the active focus at runtime. I am using UlitmateEditor(Text Editor) i.e User Control , so i want focus inside the body of that Editor.

like image 504
mehul9595 Avatar asked Feb 23 '11 16:02

mehul9595


People also ask

How do I get current Tabindex?

If you want to know tabindex of current element in HTML, then you should use document. activeElement. tabIndex .

How do I find my Tabindex in HTML?

HTML tabindex Attribute The tabindex attribute specifies the tab order of an element (when the "tab" button is used for navigating). The tabindex attribute can be used on any HTML element (it will validate on any HTML element. However, it is not necessarily useful).

What is the use of tab Index property of the control?

The following example uses the TabIndex property to display and set the tab order for individual controls. You can press Tab to reach the next control in the tab order and to display the TabIndex of that control. You can also click on a control to display its TabIndex.

What is the difference between Tabindex 0 and Tabindex =- 1?

tabindex= "0" allows elements besides links and form elements to receive keyboard focus. It does not change the tab order, but places the element in the logical navigation flow, as if it were a link on the page. tabindex= "-1" removes the element from the navigation sequence, but can be made focusable using javascript.


1 Answers

You should be able to just do:

alert(document.activeElement.tabIndex);

The should get you the active control and its tab index.

like image 153
Kelsey Avatar answered Oct 05 '22 12:10

Kelsey