Is there a jQuery unfocus method?

How can I unfocus a textarea or input? I couldn't find a $('#my-textarea').unfocus(); method?


Solution 1:

$('#textarea').blur()

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

Solution 2:

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

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

Solution 3:

Guess you are looking for .focusout()

Solution 4:

I like the following approach as it works for all situations:

$(':focus').blur();