title: Creating a div using JavaScript/Dom and a textarea
body: <p>I  have this code and it isn't working the way i want. I want it to create a new div under the other one everytime the button is clicked, but it is just changing the content of the div. help</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  p{
  background-color: red;
  font-family: arial;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  Name: &lt;textarea id="myText" value=""&gt;&lt;/textarea&gt;
  
  &lt;button type="button" onclick="myFunction()"&gt;Enviar&lt;/button&gt;
  
  &lt;div id="demo"&gt;&lt;/div&gt;
  
  &lt;script&gt;
  function myFunction() {
      var x = document.getElementById("myText");
      var defaultVal = x.defaultValue;
      var textoComentario = x.value;
  
      if (defaultVal == textoComentario) {
          alert("Digite um comentário!");
      } else {
             document.getElementById("demo").innerHTML =  "&lt;p&gt;" + textoComentario + "&lt;/p&gt;";
          x.value = "";
  
      }
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>