Using jQuery, I can test if an input field has focus like so:
if ($(\"...\").is(\":focus\")) { ... }
How do I do that without using jQuery?
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