jQuery if($(element).find(selector)) stops script on failure to find
<p>as part of a script i am working on i have the following:</p>

<pre><code>loop
if($(element).find(selector))
{ do stuff }
else
{ do other stuff }
/loop
</code></pre>

<p>The idea is that there are two versions of the elements getting looped and I need to distinguish between them (based on content) to determine which actions to take.</p>

<p>This works great if find is successful.  If it is not, then the script has a fatal error.</p>

<p>I can't find any documentation on what happens when find fails.  How do I make this work?</p>
