Home > Software design >  JavaScript "\r" carriage return is not working in recent version of Chrome 93.0.4577.82 w
JavaScript "\r" carriage return is not working in recent version of Chrome 93.0.4577.82 w

Time:09-22

Example

"Hello test"   "\r welcome world"

Current output :

Hello testwelcome world

expected output :

Hello test
welcome world

CodePudding user response:

The easiest way to break lines in JS is, using <br> tag. That's the line breaking tag in HTML.

Example

"Hello test <br> welcome world"

Here is the answer.

document.write("Hello test <br> welcome world")

All the best.

CodePudding user response:

Okay! Add to the place you want to encode a line break on the URL.

  • - carriage return character
  • - line break character

Example :

"Hello test
welcome world"
  • Related