0

I have users inputting text like My website is facebook.com. How I can convert the URL to a link so the user can click URL to be redirected to facebook.com?

Input:

My website is facebook.com

Output (expected):

My website is <a href="https://www.facebook.com/">facebook.com</a>

Anyone can help? Thank you in advance.

chris85
  • 23,846
  • 7
  • 34
  • 51
  • Yes. I want to link text with "website address" when user comment in my website. – followconscience Nov 22 '16 at 00:28
  • Thank you chris58 for your help. When we comment in facebook, or type text in gmail (paragraph include website address), facebook, gmail auto link website address, and we can click it to redirect another page. – followconscience Nov 22 '16 at 00:36
  • You mean if the user types in just a domain you want it to be auto linked? Yes. I mean that. – followconscience Nov 22 '16 at 00:41
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/128661/discussion-between-followconscience-and-chris85). – followconscience Nov 22 '16 at 00:43
  • 2
    Thank you very much chris85. Here the answer for my question (from Chris85): http://stackoverflow.com/questions/11529396/convert-urls-from-text-to-links-even-if-no-protocol – followconscience Nov 22 '16 at 00:58

0 Answers0