add link to text using span html

Solutions on MaxInterview for add link to text using span html by the best coders in the world

showing results for - "add link to text using span html"
Isaac
19 Nov 2018
1<script type="text/javascript">
2
3    $('.convertableIdentifier').each(function(i, el) {
4
5        // grab the url and the link text
6        var url = $(el).html();
7
8        // create a new node with query by decorating a
9        // empty a tag
10        var newNode = $('<a></a>').attr('href', url).attr('target', '_blank').html(url);
11
12        // replace the current node with our new node
13        $(el).replaceWith(newNode);
14
15    });
16
17</script>
Dante
02 May 2018
1<script type="text/javascript">
2    $(document).ready(function(){
3        $('td span').each(function(){
4            $(this).html("<a href='" + $(this).html() + "' />" + 
5                $(this).html() + "</a>");
6        });
7    });
8</script>
Edoardo
08 Jun 2018
1<a href="http://www.domain.com/about" target="_blank">http://www.domain.com/about</a>
Riccardo
15 Nov 2017
1var href = jQuery('#linkChange').html();
2var link = "<a href='"+href+"' target='_blank'>"+href+"</a>";
3
4jQuery('#linkChange').replaceWith(link);
Jessica
08 May 2018
1<span>http://www.domain.com/about</span>
Rafael
19 Sep 2018
1<span id="linkChange">http://domain.com</span>