title: Is there a way in Javascript to turn links in an HTML document into clickable links?
body: <p>Is there a way in pure Javascript to turn links in an HTML document into clickable links? I do not want to use regex to solve this problem.</p>
  
  <p>Let's say I have this list in an HTML5 doc:</p>
  
  <pre><code>&lt;pre&gt;
  http://www.test.com
  http://www.example.com
  http://nicelink.com
  &lt;/pre&gt;
  </code></pre>
  
  <p>And I want it to automatically turn into this when the page is loaded:</p>
  
  <pre><code>&lt;pre&gt;
  &lt;a href="http://www.test.com"&gt;http://www.test.com&lt;/a&gt;
  &lt;a href="http://www.example.com"&gt;http://www.example.com&lt;/a&gt;
  &lt;a href="http://nicelink.com"&gt;http://nicelink.com&lt;/a&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p>What would the vanilla JS code look like if I put a script in the header? Something looping through the HTML code and replacing the lines I suppose but I cannot write it in JS.</p>
  
  <p>Signy</p>