<div class="aa" style="width: 200px;height: 200px;background-color: red;"></div>
js code
$(document).mouseup(function(e) { var _con = $('.aa'); // set the target area if (!_con.is(e.target) && _con.has(e.target).length === 0) { alert("4545"); } });
When we click outside this div, an event will be triggered, where business and logic can be written