How do you detect which form input has focus using JavaScript or jQuery?
From within a function I want to be able to determine which form input has focus. I\'d like
document.activeElement, it's been supported in IE for a long time and the latest versions of FF and chrome support it also. If nothing has focus, it returns the document.body object.
document.activeElement
document.body