Getting the links containing an image
<p>I have the following code:</p>

<pre><code>var thumbs = $("#thumbs img");
var links = $("#thumbs a");
</code></pre>

<p>This gives me two variables which contain all the images and links within the 'thumbs' div ID.</p>

<p>What I need is an array that would contain the links wrapped around the image tags like this:</p>

<pre><code>&lt;a href="www.google.com"&gt;&lt;img src="image1.gif"&gt;&lt;/a&gt;
</code></pre>

<p>This is what the code already looks like within the 'thumbs' div. Should I be using the <code>.children()</code> method?  If so could you please show me an example.</p>

<p>Thanks!</p>
