Javascript 如何获取当前活动控件的 TabIndex 属性?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5093985/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get TabIndex property of currently active control?
提问by mehul9595
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.
如何找到TabIndex
在运行时具有活动焦点的控件的属性。我正在使用 UlitmateEditor(Text Editor) 即用户控件,所以我希望焦点在该编辑器的主体内。
回答by Kelsey
You should be able to just do:
你应该能够做到:
alert(document.activeElement.tabIndex);
The should get you the active control and its tab index.
应该为您提供活动控件及其选项卡索引。
回答by DevSlick
回答by kirilloid
AFAIK asp.net is a technology for serving HTML pages =)
If you want to know tabindex of current element in HTML, then you should use
document.activeElement.tabIndex
. this seems to be javascript question, though.
AFAIK asp.net 是一种为 HTML 页面提供服务的技术 =)
如果您想知道 HTML 中当前元素的 tabindex,那么您应该使用
document.activeElement.tabIndex
. 不过,这似乎是 javascript 问题。