document get active element from event code example Example: Javascript find element with focus var currentElementWithFocus=document.activeElement;