Jquery intersect selector
<p>I'm sure the answer exists on SO somewhere, but I'm at a loss for what terminology to search for.  So apologies if this is a duplicate.</p>

<p>Is there an easy way in jQuery/JS of selecting the elements that "intersect" from the following HTML?</p>

<pre><code>&lt;div id="first"&gt;
  &lt;div id="source-AAA"/&gt;
  &lt;div id="source-CCC"/&gt;
  &lt;div id="source-EEE"/&gt;
  &lt;div id="source-FFF"/&gt;
&lt;/div&gt;
&lt;div id="second"&gt;
  &lt;div id="BBB"/&gt;
  &lt;div id="CCC"/&gt;
  &lt;div id="DDD"/&gt;
  &lt;div id="FFF"/&gt;
&lt;/div&gt;
</code></pre>

<p>i.e. getting hold of the elements <code>#CCC</code> and <code>#FFF</code> from <code>div#second</code>, based on the fact that these two IDs are in <code>#first</code>?</p>

<p>I guess the proper answer is to do the intersect on the server-side (which is possible, but painful, as the two data sets come from different components), but I thought I'd check in case anyone knows of a neat way to do it in jQuery?</p>
