Answers:
$('#textarea').blur()
文档位于:http : //api.jquery.com/blur/
$('#textarea').bind('blur', function() ...)
也很棒
根据您的问题,我相信答案是如何触发模糊,而不仅仅是(甚至)设置事件:
$('#textArea').trigger('blur');
猜猜你在找什么 .focusout()
focusout
仅在输入开始失去焦点之后才触发-1 。提问者希望把一个元素在该州的SOA回调处理程序,对自己没有好处developer.mozilla.org/en-US/docs/Web/Reference/Events/focusout api.jquery.com/focusout
这对我有用:
// Document click blurer
$(document).on('mousedown', '*:not(input,textarea)', function() {
try {
var $a = $(document.activeElement).prop("disabled", true);
setTimeout(function() {
$a.prop("disabled", false);
});
} catch (ex) {}
});
.focusout()
是与blur()
api.jquery.com/focusout稍有不同的jQuery函数,引用文档This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling)