Hello I am here with a quick question on sending user input to a div section of an html document. I asked this question earlier and it seemed to be too broad so I'm going to try to be more specific this time.
I am attempting to send a user input to the div onclick of the send button but every time the code is simply changing the text rather than printing the next text under it. I'm curious what I'm doing wrong with this. Thanks for reading and here's my code.
<div id="out"</div>
<input type="text" name="textIn" id="txtin">
<input type="button" value="Hit me" onclick="hello()"></input>
<script>
function hello() {
document.getElementById("out").innerHTML =
document.getElementById('txtin').value + "<br />"
}
</script>
<div id="out"</div>- Is that your actual code?<div id="out"></div>then @Jay Buckman answered correctly