jQuery StopPropagation issue
<p>I want to close the div if someone clicked outside that div. I have the below code:</p>

<pre><code>   $('body').click(function(e) {
        $('div.test').slideUp('slow');
    });
    $('div.test').live('click',function(e) {
        e.stopPropagation();
    });
</code></pre>

<p>But the issue is that when someone click inside the div, the div itself is closing. I want to prevent that. After debugging I found a weird stuff the debugger is hitting the $(body).click first instead of $(div.test), May I know the reason for this? Can you help me in fixing the issue?</p>
