“JQuery Check Element tem foco” Respostas de código

JQuery Check Element tem foco

//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
}
Grepper

JQuery Check Element tem foco

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

Respostas semelhantes a “JQuery Check Element tem foco”

Perguntas semelhantes a “JQuery Check Element tem foco”

Mais respostas relacionadas para “JQuery Check Element tem foco” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código