开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜