How to get TabIndex property of currently active control?

mehul9595 picture mehul9595 · Feb 23, 2011 · Viewed 25.4k times · Source

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.

Answer

Kelsey picture Kelsey · Feb 23, 2011

You should be able to just do:

alert(document.activeElement.tabIndex);

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