♦ jQuery focus()
♣ Example6: jQuery focus()
The focus() method is used in form field functioning.Action is executed when the form input is active to be entered.
Below is the representation of focus() Syntax.
Basic Syntax
$(selector).focus(function(){
//code_block
})
//code_block
})
Syntax Explanation:
selector : element selector for event to be performed
code_block : code for execution, which will execute when event is performed
In this example, .code_block : code for execution, which will execute when event is performed
Example
Input:
Output: