I have a very simpel jQuery function where i want to pass the link string containg an url to a span containing a class called .post-link
But the whole string of link is not being passed before .post-link.
Can anybody please tell me why. According to jQuery library i should be able to pass html with .before()
The link is being copyed from a span
<span class="post-link">some link</span>
var link = '<a href="' + $(this).find('.post-link').text() + '">';