To save data flow I use these lines to wrap text in a pattern with anchors, the code executed successfully, but why it seems that the generated anchors are not clickable?
$(function(){
$(".block span").each(function(){
$(this).wrapInner("<a></a>")
$(this).find("a").attr("herf","/tag/"+encodeURIComponent($(this).html()));
})
})
And you could also see jsfiddle here:http://jsfiddle.net/vftMe/
Is there any error in my code? Or it’s just the browser’s limit? What’s the alternative way to do this?
herfshould behref:Updated fiddle: http://jsfiddle.net/94X72/