Access $.data() inside a selector
<p>I have the following code: </p>

<pre><code>&lt;img class="sth" data-number="1" src="sth.jpg" alt=""&gt;
</code></pre>

<p>There are a couple of such elements, and they all differ only in data-number. I want to do the following for all elements: </p>

<pre><code>$('.sth').attr('src', 'sth' + data('number') + '.jpg');
</code></pre>

<p>so that every image changes the src with its own number.</p>

<p>However, data('number') does not work, and $('.sth').data('number') changes all with sth1.jpg. </p>

<p>Is there a way to do this?</p>
