开发者

How do I tell what element has the focus on page load? Is this possible?

I'm looking for some co开发者_高级运维de that I can run in the jQuery(document).ready() function that will let me get the current focused element. Is this possible?

Cheers, Pete


You can use document.activeElement (also on MSDN), which is roughly the same thing. It will start out as the <body> element, unless the user or a script has moved the focus.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜