I would like to find out, in JavaScript, which element currently has focus. I\'ve been looking through the DOM and haven\'t found what I need, yet. Is there a way to do this
If you're using jQuery, you can use this to find out if an element is active:
$("input#id").is(":active");