![]() ![]() ![]() \n What is your name?"įormatting Generated HTML with the Newline Character ![]() Now see what happens to the same string when line breaks are included: Here is a long string without line breaks: The newline character creates line breaks within the output of a string, be it simply text or JavaScript-generated HTML. The first is the newline character ( \n ). To keep long concatenation output readable, JavaScript provides two ways to create line breaks within your string. While this is acceptable when working with short strings, string output will often be too long to be readable on one line. Perhaps not obvious to you while reading the previous string concatenation lesson was how the resulting strings printed to alert boxes were output onto a single line. View Source Chart Creating Line Breaks In JavaScript Strings
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |