jquery check hover code example
Example 1: jquery check if element exists
// Check if an element currently exists
if ($('#element').length) {
}
Example 2: 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
}