title: Having a jQuery .click() event only fire once when inside another .click() event
body: <p>If I have a jQuery .click() event firing for both "body" and a "div", how would I get it to only execute for the div and not the body when the div is clicked? Basically, I'm making my own context menu and I want clicking anywhere outside the element (in this case, "div.button") to close the menu.</p>
  
  <p>Rudimentary example:</p>
  
  <pre><code>  $("body").click(function(event){
      if($("div.menu").is(":visible")){
        $("div.menu").hide();
      }
    });
  
    $("div.button").click(function(event){
      $("div.menu").show();
    });
  </code></pre>
  
  <p>As you can guess, the $("body").click() prevents/hides the menu from even showing.</p>
  
  <p>A little guidance would be much appreciated. Thanks for reading!</p>