+ 1
How to transform plain text URL into html hyperlink?
for example I want to be able to change www.sololearn.com into <a href="www.sololearn.com" />.
7 Answers
+ 1
If I'm understanding you correctly, you're not wanting to display the link, but simply want the code itself to be shown?
<pre><a href="sololearn.com">test</a></pre>
For the < and >, use & lt; and & gt; instead. (remove spaces from char code)
<pre> & lt;a href="sololearn.com"& gt; test & lt; /a & gt; </pre>
*EDIT*
I forgot Code Playground was a thing. Here you go. :P
https://code.sololearn.com/WYlCR1rWWZ7E/#html
+ 2
a simple url is always a hyperlink.. there's nothing link html hyperlink..
if u want to write a Html code for your url or hyperlink..
u need to use anchor tag <a></a> and place your link in between it as href attribute's value..
<a href="https://www.sololearn.com">Sololearn</a>
+ 2
thank you guys, upvoted
+ 1
https://code.sololearn.com/WYlCR1rWWZ7E/#html
^That's what you're looking for I believe.
0
no, you don't understand. I want every plain text URL in for example, a chat website, to be clickable (so transformed into a hyperlink <a />
of course I know how to make a link... this would work with a PHP code for example
0
ok u mean to say when you click on any link then it's Html code gets generated ?
0
yeah something like that