jQuery Tutorial Tutorials - jQuery .focusin() method

jQuery .focusin() method

The .focusin() method in jQuery is used to bind an event handler to the focusin event.

It supports event bubbling. When an element ,or any element inside of it,gains focus, a focusin event would be sent to it.

The focus event does not bubble.

jQuery .focusin() method Syntax

.focusin()
.focusin(handler)
.focusin(eventData,handler)
Parameter Type Description
handler Function A function to execute when the focusin is triggered on the matched element.
eventData Anything Additional data passed to the event handler.

jQuery .focusin() method Example

example

Watch for a focus to occur within the paragraphs
HTML

<p><input type="text" name="username"></p>
<p><input type="text" name="email"></p>
$( "p" ).focusin(function() {
    console.log("Handler for .focusin() called.");
});

Try now

Date:2019-08-29 19:32:36 From:www.Lautturi.com author:Lautturi