Possible Duplicate:
Jquery Unfocus
Is there a way to deselect/unfocus an input field using JQuery? Something like $("input#name").select().focus();
but in reverse?
.blur();
reference: http://api.jquery.com/blur/
Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
...This method is a shortcut for...
.trigger( "blur" )
...The
blur
event is sent to an element when it loses focus. Originally, this event was only applicable to form elements, such as<input>
. In recent browsers, the domain of the event has been extended to include all element types. An element can lose focus via keyboard commands, such as the Tab key, or by mouse clicks elsewhere on the page...
You can use the blur method from jQuery API
So it would be:
$('input').blur();
Hope it was useful !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With