adding carriage return to string

I want to add a carriage return to a string.  I tried asc(10) and chr(10), but keep getting an error.
aricheeAsked:
Who is Participating?
 
knightEknightConnect With a Mentor Commented:
Try this:

 var mystring = "blah blah \n blah blah";
 alert(mystring);
0
 
knightEknightCommented:
The \n is a js carriage return.  BUT if you want this to be displayed in HTML then you must either surround the text with <PRE> and </PRE> tags, or you must use "<BR>" instead of "\n".

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.