Transform <span class="XX">text</span> into <a class="XX">text</a>
Hello,
I'd just want to transform for some obscur reason all my
- <span class="XX">text</span>
(
where XX is unknown)
into
I do a wheel like
- $('span').each(function(index, value){
-
- }
that works, I could do a
- $(this).replaceWith($('<a>' + this.innerHTML + '</a>'));
but how to keep the attributes ?
Thank you in advance for your help