JQUERY: Find images and wrap in li and link
<p>Could anybody help me with some Jquery. I have a <code>&lt;div&gt;</code> with a bunch of images inside. I need to grab all the images, empty the <code>&lt;div&gt;</code>, wrap each image in an anchor with the image's <code>src</code> as the <code>href</code> and then wrap the link in a <code>&lt;li&gt;</code>.</p>

<p>This is what I have so far:</p>

<pre><code>    var b = $('#thumbs .thumbs'); // Get a reference to the banner div
    var i = b.find('img'); // Pull all the images
    var s = i.attr('src');
    b.empty().append(i); // Empty the banner div, and replace the images
    b.find('img').wrap('&lt;li&gt;&lt;a href=" 'src' " /&gt;&lt;/li&gt;'); // Wrap the images
</code></pre>

<p>Can anybody help?</p>
