How can I get the active element(focussed textbox or rich text box) from a JavaScript bookmarklet? I want to change the text of a focussed textbox or rich text box when someone clicked on my bookmarklet. Is it possible?
+3
A:
Just accessing document.activeElement
works in Firefox 3.6, IE 7, Chrome 6 and Safari 4. Untested in anything else.
Tim Down
2010-10-27 16:27:52
I tested this in IE 8. It works.
Gabriel McAdams
2010-10-27 17:38:03