jQuery focus() method

Definition

If you want to trigger an event when an input field gets focus or a mouse is clicked, then use the jQuery focus() method.

Syntax

The following is the syntax,

The following is the parameter used in the jQuery focus() method,

  • func: When event occur, this function runs. It is an optional parameter.

Example

The following is the output,

Click inside the input field to trigger the event,

jQuery dblclick() method
jQuery focusin() method
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading