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
<!DOCTYPE html>
<html>
<head>
<style>
p{
background-color: red;
font-family: arial;
}
</style>
</head>
<body>
Name: <textarea id="myText" value=""></textarea>
<button type="button" onclick="myFunction()">Enviar</button>
<div id="demo"></div>
<script>
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 = "<p>" + textoComentario + "</p>";
x.value = "";
}
}
</script>
</body>
</html>