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.
If you want to know tabindex of current element in HTML, then you should use document. activeElement. tabIndex .
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).
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.
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.
You should be able to just do:
alert(document.activeElement.tabIndex);
The should get you the active control and its tab index.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With