est focus vanilla javascript

this === document.activeElement // where 'this' is a dom object
Andrew Lautenbach