Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

adding carriage return to string

Posted on 2000-03-09
2
Medium Priority
?
325 Views
Last Modified: 2012-05-04
I want to add a carriage return to a string.  I tried asc(10) and chr(10), but keep getting an error.
0
Comment
Question by:arichee
  • 2
2 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 200 total points
ID: 2601723
Try this:

 var mystring = "blah blah \n blah blah";
 alert(mystring);
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2601732
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question