This question was answered here: Javascript detect if input is focused
Taken from the above answer:
this === document.activeElement // where 'this' is a dom object
This question was answered here: Javascript detect if input is focused
Taken from the above answer:
this === document.activeElement // where 'this' is a dom object