Take <span> class and put in <a> attribute jquery
<p>I have html like this.</p>

<pre><code>&lt;span class="gallery-open-item year-icon-Yes 2010"&gt;
&lt;a href="/year/none"&gt;
&lt;/a&gt;
&lt;/span&gt;
</code></pre>

<p>I need to check using jQuery if <code>span.gallery-open-item</code> has <code>year-icon-Yes</code> class, and if so take the next (for this example is 2010) class and place it in the <code>href</code> attribute like this:</p>

<pre><code>&lt;a href="/year/2010"/&gt;
</code></pre>

<p>All this I need in jQuery or JavaScript.</p>

<p>I have done some experiments but I can't take 2010 to normal javascript variable.
Any ideas?</p>

<p>Sorry for my English.</p>
