check if html input is active 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
}