And there is also natural HTML solution
: see http://www.w3schools.com/tags/tag_pre.asp: Text in a 
 element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks. Connect and share knowledge within a single location that is structured and easy to search. But the line feed character does NOT render as a line break in HTML (see notes at bottom). WebStarter project for Angular apps that exports to the Angular CLI Starter project for Angular apps that exports to the Angular CLI StackBlitz. When did the U.S. Army start saying "oh-six-hundred" for "6 AM"? classes can be used to style textarea elements according to their state. The name attribute is needed to reference  The LF character does not render to a new line or line break in HTML. Asking for help, clarification, or responding to other answers. How to read and write json file in PHP Laravel? You can convert the default textbox into the multiline textbox by setting the multiline API value as true or pass HTML5 textarea as element to the textbox. I announced my resignation . full time. How to Create a Dropdown List with Array Values using JavaScript ? I have a service that return a string as result. How to get selected value in dropdown list using JavaScript ? How often do people who make complaints that lead to acquittals face repercussions for making false complaints? If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: , W3Schools is optimized for learning and training. The