activeElement property of the DOCUMENT object. Returns a link to the active element (tag: INPUT, TEXTAREA, BODY). document.activeElement EXAMPLE: show the html-code of the currently active element:EXAMPLE: set a link to an active element and show its html-code: