Hide when clicked on document except when clicked on a div
<p>I want to hide a div when clicked on a document but I dont want to hide that div when someone clicks in it or clicks a link or a button in it. Also, I have some links inside that div set to prevent the click action (return false;) and send a ajax request.</p>

<p>I tried:</p>

<pre><code>$(document).click(function(e) {
      $('#bubble').hide();
});

$('#bubble').click(function(e) {
    return false;
});
</code></pre>

<p>It works fine but the links and buttons under the #bubble doesn't work.</p>
