jQuery focusin() method

jQuery focusin() method

Definition

Trigger an event when an element gets focus, using the jQuery focusin() method. The focus() and focusin() method looks the same, but are different. The focus() method does not trigger if a child element gets focus.

Note: The focusout() method is used often along with focusin().

Syntax

The following is the syntax,

The following is the parameter used in the jQuery focusin() 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 get focus,

jQuery focus() method
jQuery focusout() method
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment