jQuery function in .attr is called only once for all matching tags
<p>I'm teaching myself jQuery by writing the game of memory (where you turn tiles over two at a time, looking for matches).</p>

<p>I have 16 img tags, each representing one of the tile faces.  I have an array of 16 jpg file names.  I want to set the src attribute of each img tag to a random selection from my array.  To do so, I wrote a function that extracts a string from the array, removes the string from the array, and returns the string.  I then use this function in the onReady handler this way:</p>

<pre><code>$('.picture').attr( {src : extractArrayValue(cousinPictures)});
</code></pre>

<p>This seems to work, except that it appears that the function extractArrayValue appears to be called only once across all 16 tags.  All 16 img tags get the same image, but if I refresh the page they get a <em>different</em> same 16 image files.</p>

<p>Am I correct about what's happening?  And, if so, is there a straightforward way to force extractArrayValue to get called for each attribute that gets set?</p>
