View Full Version : how do you create a new line

Dec 20th, 2006, 04:24 PM
im making a script that creates a line of data then makes a new line and writes more data ex:

data data data
data data data

heres the code im using:

while (x!=3)
document.form1.textarea1.value+="data data data";

how do i make a new line???????????????


Dec 20th, 2006, 04:30 PM
(Textarea must be set to accept line breaks with wrap property.)

Try "\n" or "\r\n".

document.form1.textarea1.value+="data data data" + "\n";
document.form1.textarea1.value+="data data data" + "\r\n";

I left it as a separate string, because I assume "data data data" is actually some variable somewhere.