Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

add link to text using span html

<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
        $(el).replaceWith(newNode);

    });

</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #link #text #span #html
ADD COMMENT
Topic
Name
9+4 =