Getting the first image elements id within an unordered list using JQuery
<p>I'm trying to get the id of the first element of an unordered list using JQuery.</p>

<p>Here's the list</p>

<pre><code>&lt;ul class="list"&gt;
&lt;li&gt;&lt;img id="1" src="image1.jpg" name="image1" /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img id="2" src="image2.jpg" name="image2" /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img id="3" src="image3.jpg" name="image3" /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img id="4" src="image4.jpg" name="image4" /&gt;&lt;/li&gt;
&lt;li&gt;&lt;img id="5" src="image5.jpg" name="image5" /&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>JQuery</p>

<pre><code>var id = $('.list li img'):first.attr('id');
</code></pre>
