$(document).mousedown(function(e){ var _con = $("#up-list-ul-qlc"); if(!_con.is(e.target) && _con.has(e.target).length === 0){ $("#up-list-ul-qlc").hide(); } });