如何取消文本区域或输入的焦点?我找不到$('#my-textarea').unfocus();方法?
这对我来说很管用:
// 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) {}
});