12

i have been running around in circles with this situation, i already tried all the answers that i found in stackoverflow and tried to use linkify aswell but with no success, can't make it work and i would rather NOT have to use any Javascript libraries, jquery, mootools etc...

So here is what i am trying to achieve;

I have a comment section for each of my posts and i want that each time a user posts a url in his comment:

<div id="container">
Nice, here is the respective link that you were asking for: www.linkforanywebsite.com
</div>

turns into this:

<div id="container">
Nice, here is the respective link that you were asking for: <a href="www.linkforanywebsite.com">www.linkforanywebsite.com</a>
</div>

Any guide/jsfiddle working example are very appreciated

Thank you for your time and help!

Shadow
  • 4,168
  • 5
  • 41
  • 72
  • 1
    I created this library that might help anyone looking for a solution in this page: https://github.com/ali-saleem/anchorme.js – Alex C. Jul 16 '15 at 19:51
  • Maybe this can be useful for you. http://stackoverflow.com/questions/37684/replace-url-with-html-links-javascript – Javi Prieto Mar 03 '11 at 13:15

0 Answers0