selector using variable
<p>Usually when I want to check if any child element inside a parent element was clicked I use something like this:</p>

<pre><code>$(document).click(function (e) {
    alert($(e.target).is("#somediv *"));
}
</code></pre>

<p>But now I have the <code>somediv</code> in a variable. I have tried:</p>

<pre><code>var somediv = $(this);
$(document).click(function (e) {
    alert($(e.target).is($(somediv, "*")));
}
</code></pre>

<p>But it doesn't work. How can I do that? Is it the best way to detect if a element or any child element was clicked?</p>
