title: How to know if a clicked element is inside a main one with jQuery?
body: <p>I have a little doubt, I made a login form and I'd like to hide it when I click outside its space. OK, imagine I have this:</p>
  
  <pre><code>&lt;div id="main-space"&gt;
      &lt;div id="form-style"&gt;
          &lt;input type="text" /&gt;
          &lt;br /&gt; &lt;br /&gt;
          &lt;input type="password" /&gt;
      &lt;div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Well, I'd like to hide <em>main-space</em> when I click an element outside this login "box". I tried many ways, but no one worked. And believe me, I searched a lot around, and I didn't find any solution.</p>
  
  <p>By the way, I'm looking for a jQuery solution if it's possible.</p>