Use blur event to call your function when element loses focus :
$('#filter').blur(function() {
$('#options').hide();
});
Use blur event to call your function when element loses focus :
$('#filter').blur(function() {
$('#options').hide();
});