How to hide div when clicked outside it?

    Use following jquery code to do so?
    <script language="javascript">
    $(document).ready(function () {
        $('.drop_div').hover(function(){
          var mouse_over=true;
        }, function(){
          var mouse_over=false;
        });

        $("body").mouseup(function(){
          if(! mouse_over) $('.drop_div').hide();
        });
    });
    </script>
    Any problem in implementation contact us
    5
    Average: 5 (1 vote)