How to get background image of the first div with a specified class using jquery?
<p>How do I get the first "grid_5" class div background image url? (eg: test1.jpg in the following example)</p>

<pre><code>&lt;div&gt;
&lt;div class="grid_5" style="background: url("test1.jpg");"&gt;
&lt;div class="grid_5" style="background: url("test2.jpg");"&gt;
&lt;div class="grid_5" style="background: url("test3.jpg");"&gt;
&lt;/div&gt;
</code></pre>

<p>I tried the following but it doesnt work:</p>

<pre><code>$('.grid_5:first').attr('background')
$('.grid_5')[0].attr('background')
</code></pre>

<p>Please tell me why is that and what should be the correct code for it.</p>

<p>Thanks in advanced.</p>
