Take <span> class and put in <a> attribute jquery

Posted by Toktik on Stack Overflow See other posts from Stack Overflow or by Toktik
Published on 2010-06-12T16:44:00Z Indexed on 2010/06/12 16:52 UTC
Read the original article Hit count: 174

Filed under:
|

Hello,

I have html like this.

<span class="gallery-open-item year-icon-Yes 2010">
<a href="/year/none">
</a>
</span>

I need to check by jquery if span.gallery-open-item have year-icon-Yes class take next(for this example is 2010) class and place it in a href attribute like this

All this I need in jQuery or JavaScript.

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

Sorry for my english.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery