title: Creating anchor tags dynamically in HTML using JavaScript
body: <p>I have a question about anchor tags and javascript.<a href="https://i.stack.imgur.com/myR7q.png" rel="noreferrer">Converting a URL to an anchor tag</a></p>
  
  <p>The text box accepts a url (eg. "www.youtube.com")</p>
  
  <p>I made a Javascript function that adds "http://" to the link.</p>
  
  <p>How do I make it so the convert button adds a link on the webpage that takes you to the website in another tab.</p>
  
  <p>My Javascript code is as follows:</p>
  
  <pre><code>var webpage="";
  var url="";
  var message="";
  var x= 0;
  var page="";
  
  function convert()
  {       
      url=document.getElementById("link").value;
      webpage = "http://" + url;  
  }
  </code></pre>