jQuery focus() Method
jQuery focus() Method
The focus event is used to occur when an element gets focused. The focus() method triggers the focus event. We can attach a function when a focus event occurs. It is sometimes used together with the blur() method.
Syntax:-
Its syntax is:- $(selector).focus(function)
Further Explanation:-
Parameter | Description |
---|---|
function | Optional. Specifies the function to run when the blur event occurs |