title: Add Link Element <a> to paragraph <p> Javascript
body: <p>I am trying to add a link into a paragraph that already has some text in it, but when I try this is just adds the text of the link element and not actual link. href or <code>&lt;a&gt;</code> tag. Here is html</p>
  
  <pre><code>&lt;div id="main_div"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And here is Javascript</p>
  
  <pre><code>var temp_link = document.createElement("A");
  temp_link.href = "http://test.com";
  temp_link.target = '_blank';
  
  var par = document.createElement("P");
  par.innerHTML = "some text: " + temp_link;
  
  &lt;!--I have also tried this line below --&gt;
  &lt;!--    par.insertAdjacentHTML('beforeend', '&lt;div&gt;&lt;a&gt;' + url +'&lt;/a&gt;&lt;/div&gt;' --&gt;);
  
  document.getElementById("main_div").appendChild(par);
  </code></pre>
  
  <p>I have tried two things what is in the above javascript both what it would currently run and the line that is commented out, neither attach the link, they just add the text I have included <a href="http://jsfiddle.net/bys0xfoa/" rel="nofollow">JSFiddle</a>.</p>
  
  <p>How can I add it so that <code>&lt;a&gt;</code> links?</p>