• 0

JS word generator help


Question

what i must change in this code to generate a new line like this

(new)

tueuzl1

1c2uy3z

8l1mdad

76rmze0

y1yo15g

h9kgvbh

h9i6q6w

(old)

tueuzl1 1c2uy3z 8l1mdad 76rmze0 y1yo15g h9kgvbh h9i6q6w

<P>
<INPUT TYPE="button" VALUE="Click to generate letter sequences"
	   ONCLICK="document.generator.output.value = '';
				for(i=1;i<=document.generator.numSeq.value;i=i+1) {
				  document.generator.output.value += 
						generateRandSeq(document.generator.lenSeq.value,
										document.generator.letters.value) + ' ';
				};">

<P>
<TEXTAREA NAME="output" ROWS=10 COLS=40 WRAP VALUE=""></TEXTAREA>

I think that this is the part of the code that i must modify.

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

change

generateRandSeq(document.generator.lenSeq.value, document.generator.letters.value) + ' ';

to

generateRandSeq(document.generator.lenSeq.value, document.generator.letters.value) + '\n';

\n is the escape character for a new line. \t for tab. They're the only ones I know off the top of my head.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.