add link to text using span html code example
Example 1: add link to text using span html
<script type="text/javascript">
$(document).ready(function(){
$('td span').each(function(){
$(this).html("<a href='" + $(this).html() + "' />" +
$(this).html() + "</a>");
});
});
</script>
Example 2: add link to text using span html
<span id="linkChange">http://domain.com</span>
Example 3: add link to text using span html
var href = jQuery('#linkChange').html();
var link = "<a href='"+href+"' target='_blank'>"+href+"</a>";
jQuery('#linkChange').replaceWith(link);
Example 4: add link to text using span html
<span>http://www.domain.com/about</span>
Example 5: add link to text using span html
<script type="text/javascript">
$('.convertableIdentifier').each(function(i, el) {
var url = $(el).html();
var newNode = $('<a></a>').attr('href', url).attr('target', '_blank').html(url);
$(el).replaceWith(newNode);
});
</script>
Example 6: add link to text using span html
<a href="http://www.domain.com/about" target="_blank">http://www.domain.com/about</a>