Possible Duplicate:
How do I find out which DOM element has the focus?
Is there a way in javascript to determine which html page element has focus?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the
document.activeElementproperty.The
document.activeElementproperty is supported on Chrome 2+, Firefox 3+, IE4+, Opera 9.6+ and Safari 4+.Note that this property will only contain elements that accept keystrokes (such as form elements).