I have dynamically generated text that may contain links to webpages. I want to automatically detect if a user has "www.someaddress.com" or "http://someaddress.com" or "http://www.someaddress.com" and make it a true hyperlink instead of just text.
HERE IS THE HTML:
Hello my name is Jake and I made a website. Check it out at www.jakewebsite.com.<div class="text_container">
Hello my name is Frank and I made a website. Check it out at www.frankwebsite.com.
</div>
<div class="text_container">
Hello my name is Jeff and I made a website. Check it out at www.jeffwebsite.com.
</div>
I attempted to try and write some jQuery code to at the least wrap the www expression in aHref tags but all its doing is putting the aHref at the begingin of the text_container. I do not know how to wrap the ahref around the entire text to make it a hyperlink either.
var foundin = $('*:contains("www.")');
foundin.prepend("<a href='test.php'>");
foundin.append("</a>");