jquery bubbling up the dom to see if there is any match to an ID
<p>I have a help div that becomes visible, I made it so that if a click is outside the div, it closes the help div.  </p>

<p>I want the div to remain open if the user click inside the div.  For regular Javascript, I use the bubbling up code to match the parent's id.  My partial JS code is </p>

<pre><code>var click = (e &amp;&amp; e.target) || (event &amp;&amp; event.srcElement);
var match = "divid";

while(click.parentNode){
        if(click==match) {
        return;//do nothing
            }//if
</code></pre>

<p>what is the jquery equivalent to this recursive javascript code?</p>

<p>TIA</p>

<p>edited to avoid confusion.</p>
