Solved

adding carriage return to string

Posted on 2000-03-09
2
305 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 50 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now