Teste de JavaScript se o elemento tem foco

var myElement = document.getElementById('myID');
if(myElement === document.activeElement){
    //myElement Has Focus
}
Grepper