js hasfocus code example
Example: javascript test if element has focus
var myElement = document.getElementById('myID');
if(myElement === document.activeElement){
//myElement Has Focus
}
var myElement = document.getElementById('myID');
if(myElement === document.activeElement){
//myElement Has Focus
}