Check out example codes for "add link to text using span html". It will help you in understanding the concepts better.

Code Example 1

<a href="" target="_blank"></a>

Code Example 2

<span id="linkChange"></span>

Code Example 3

var href = jQuery('#linkChange').html();
var link = "<a href='"+href+"' target='_blank'>"+href+"</a>";


Code Example 4

<script type="text/javascript">

    $('.convertableIdentifier').each(function(i, el) {

        // grab the url and the link text
        var url = $(el).html();

        // create a new node with query by decorating a
        // empty a tag
        var newNode = $('<a></a>').attr('href', url).attr('target', '_blank').html(url);

        // replace the current node with our new node



Code Example 5


Code Example 6

<script type="text/javascript">
        $('td span').each(function(){
            $(this).html("<a href='" + $(this).html() + "' />" + 
                $(this).html() + "</a>");

Learn ReactJs, React Native from