title: Javascript convert text to a link
body: <p>I'm trying to make it so when a user inputs text in a textbox it prints it as a link that they are able to click on. Here is my code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="text"  id="urlhtml" size ="30" placeholder="http://www.sait.ca"&gt;
  &lt;br&gt;
  &lt;br&gt;
  &lt;input type="submit" value="Add Url" id="submit"onclick="getUrlList(); return false"&gt;
  &lt;/form&gt;
  &lt;br&gt;
  &lt;h2&gt; Your favorite urls are: &lt;/h2&gt;
  &lt;a href target ="_blank" &gt;&lt;h3&gt;&lt;span id="showurls"&gt;&lt;/span&gt;
  &lt;/h3&gt;&lt;/a&gt;
  </code></pre>
  
  <p>JAVASCRIPT:</p>
  
  <pre><code> var urlList=[];
       function getUrlList () {
  
      var url={urlhtml};
      var i=0;
      var thisList="";
  
      url.urlhtml=document.getElementById("urlhtml").value;
  
      urlList.push(url);
          for(i=0; i&lt; urlList.length;i++)
          {
          var thisurl={urlhtml};
          thisurl=urlList[i];
          thisList+="http://" + thisurl.urlhtml;
          thisList+="&lt;br&gt;";
  
          }
      document.getElementById("showurls").innerHTML=thisList;
  }
  </code></pre>
  
  <p>The link gets displayed and you can click on it however it just opens up the same page and doesn't go to what the user inputted.</p>
  
  <p>Any help would be really appreciated. </p>