Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何找到TabIndex在运行时具有活动焦点的控件的属性。我正在使用 UlitmateEditor(Text Editor) 即 User Control ,所以我希望将焦点放在该编辑器的主体内。
TabIndex
你应该能够做到:
alert(document.activeElement.tabIndex);
应该为您提供活动控件及其选项卡索引。
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.tabindex.aspx
AFAIK asp.net 是一种提供 HTML 页面的技术 =) 如果您想知道 HTML 中当前元素的 tabindex,那么您应该使用 document.activeElement.tabIndex. 不过,这似乎是javascript问题。
document.activeElement.tabIndex