“jQuery Check Element имеет фокус” Ответ

jQuery Check Element имеет фокус

//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 имеет фокус

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

Ответы похожие на “jQuery Check Element имеет фокус”

Вопросы похожие на “jQuery Check Element имеет фокус”

Больше похожих ответов на “jQuery Check Element имеет фокус” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования