Answers for "how to chec wether an nput is still fcoused or no"

5

jQuery check element has focus

//test if element has focus in jQuery
if ($("#myElementID").is(":focus")) {
    //I have the focus
}

//test if element has focus in plain Javascript
var myElement = document.getElementById('myID');
if(myElement === document.activeElement){
    //myElement Has Focus
}
Posted by: Guest on August-01-2019
5

jQuery check element has focus

var myElement = document.getElementById('myID');
if(myElement === document.activeElement){
    //myElement Has Focus
}
Posted by: Guest on August-01-2019

Code answers related to "how to chec wether an nput is still fcoused or no"

Code answers related to "Javascript"

Browse Popular Code Answers by Language