How to get Tab Index of active/focused control on page using javascript
I have controls on my page, is there any w开发者_C百科ay I can get the tabIndex of active control or focused control?
Thanx
I'm assuming that you've got jQuery, since your question is tagged ASP.NET. In that case:
var tabIndex = $(':focus').attr('tabIndex');
should do it. If the element does not have an explicitly declared tabIndex
attribute, the tabIndex
var will be undefined
.
精彩评论