Using jQuery, I can check if the input field has the same value:
if ($("...").is(":focus")) { ... }
How can I do this without using jQuery?
This question has been answered: Javascript detects input is focused.
Taken from the answer above:
this === document.activeElement // where 'this' is a dom object