title: JQuery, how to make div disappear when clicked anywhere out of it?
body: <p>I am trying to achieve the following behavior: </p>
  
  <p>When link "Option" with DivA id is clicked, the DivB should show up with fade in effect. If I click the link "Option" again as well as if clicked anywhere else in the page except of the DivB inside, the DivB should dissapear again.</p>
  
  <p>This is my HTML code:</p>
  
  <pre><code>&lt;a href="..." id="DivA"&gt;Option&lt;/a&gt;
  &lt;div id="DivB"&gt;
    &lt;ul&gt;
      &lt;li&gt;A&lt;/li&gt;
      &lt;li&gt;B&lt;/li&gt;
      &lt;li&gt;C&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my JQuery code. It is wrong, if the DivB is hidden and I click anywhere in the document, the DivB appears.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).click(function () {
          $("#DivB").fadeToggle("200");
      });
      $("#DivA").click(function () {
          e.stopPropagation();
          return false;       
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Where's the mistake? Thanks for help.</p>