title: Using a form to insert an image using Javascript
body: <p>I'm using this javascript function to use a form to insert text into a set div. </p>
  
  <p>I would like to be able to put an image url into a form and use this function to insert the url into an img tag instead of a div. What way could I achieve this? </p>
  
  <p>Javascript:</p>
  
  <pre><code>function header01(){
  
      var head01v = document.getElementById('head01i').value;
  
      document.getElementById('head01c').innerHTML = head01v;
      document.getElementById('head01c').style.display = "block";
  
      return false;
  }
  </code></pre>
  
  <p>I attempted to use the suggested solution, inputting the appropriate fields</p>
  
  <pre><code> function image01(){
  
          var img = document.createElement('img');
          img.src = document.getElementById('imag01i').value;
          document.getElementById('imag01c').appendChild(img);
  
          return false;
      }
  </code></pre>
  
  <p>But to no avail, any additional help is greatly received.       </p>