Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a jQuery unfocus method?

People also ask

What is blur function in jQuery?

jQuery blur() MethodThe blur event occurs when an element loses focus. The blur() method triggers the blur event, or attaches a function to run when a blur event occurs. Tip: This method is often used together with the focus() method.

How Stop focus in jQuery?

In jQuery by using blur() property we can remove focus from input textbox field.

How do you Unfocus an element in JavaScript?

Use the blur() method to remove the focus from an element, e.g. input. blur() . If you need to remove the focus from the currently active element without selecting it, call the blur method on the activeElement property - document.

What is blur () method?

blur() method removes keyboard focus from the current element.


$('#textarea').blur()

Documentation at: http://api.jquery.com/blur/


Based on your question, I believe the answer is how to trigger a blur, not just (or even) set the event:

 $('#textArea').trigger('blur');

Guess you are looking for .focusout()