"\ r \ n" in JavaScript

Source: Internet
Author: User

We know

\ r represents a carriage return (acsii:13 or 0x0d), which means "hard return"

\ n represents a newline character (acsii:10 or 0x0a), which means "soft return"

After these two are used in the page, you won't see any effect. Because it wraps the HTML code itself, we can see the code wrap when we right-click on the source file.

So, \ n, just like you write HTML code in Visual Studio, press Enter in the code to wrap the HTML code itself. This effect is achieved by using \n\r. It is the output of a (HTML markup language), in the HTML interpreted as the input of the word lines, \ n is to feed the source code, after the input, look at the HTML source code, see there is a line break, and the HTML interpreter (Web browser) will ignore it.

If you need to display line breaks on a Web page, and display line breaks in the Web browser, you need to use <br/>

"\ r \ n" in JavaScript

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.