How to reference an image inside another tag with 'this'?
<p>I know this is pretty basic, I'm trying to get the 'src' attribute of some images and put them in the same number of #image fields:</p>

<pre><code>        count = 0;
        $('.selected').each(function() {
            count++;
            // the idea is to get the value from each ".selected img"
            $('#image' + count).val(   this + img   ).attr("src");
        });
</code></pre>

<p>How to reference the image from 'this' ? or what would be the good method ? .... Thanks !</p>

<p><strong>EDIT:</strong></p>

<p>I have something like this:</p>

<pre><code>        &lt;li&gt;&lt;img src="..." alt="" class="selected" /&gt;&lt;/li&gt;
        &lt;li&gt;&lt;img src="..." alt="" /&gt;&lt;/li&gt;
        &lt;li&gt;&lt;img src="..." alt="" /&gt;&lt;/li&gt;
        &lt;li&gt;&lt;img src="..." alt="" class="selected" /&gt;&lt;/li&gt;
</code></pre>

<p>I want to write the src attribute of those img s in this:</p>

<pre><code>    &lt;input type="hidden" id="image1" name="image1" value="" /&gt;                  
    &lt;input type="hidden" id="image2" name="image2" value="" /&gt;  
</code></pre>

<p>Thanks! </p>
