This just adds text from the textbox to the text area... <input id="inputtext"> <input value="Add text" onclick="document.getElementById('textarea').value+=inputtext.value;" type="button"> <textarea rows="7" id="textarea" name="box" cols="45"></textarea> Code (markup): I need it to add a linebreak after each text is added. How can I make <br> into an element and append it to the onClick?
<input id="inputtext"> <input value="Add text" onclick="document.getElementById('textarea').value+=inputtext.value + '\n';" type="button"> <textarea rows="7" id="textarea" name="box" cols="45"></textarea> Code (markup): hint: I changed inputtext.value to inputtext.value + '\n'