xxxxxxxxxx
$(document).ready(function() {
// Attach a focus event handler to the desired element(s)
$("input").on("focus", function() {
// Perform the action when the input gains focus
console.log("Input has gained focus!");
// Additional code can be added here to handle the focus event
});
});
xxxxxxxxxx
$( "#target" ).focus(function() {
alert( "Handler for .focus() called." );
});