Reputation: 29750
I'm looking for some code that I can run in the jQuery(document).ready()
function that will let me get the current focused element. Is this possible?
Cheers, Pete
Upvotes: 0
Views: 62
Reputation: 324737
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.
Upvotes: 2