Answer the question
In order to leave comments, you need to log in
How in this case to make the correct line break?
How to make a line break, in my case I enter some text in I textarea
press the button and the same text appears in another text area + adds elements to everything
For example, I enter "Some text" into the first area
The output is: + 'Some text \n'
But if in the first case I switch to a new line, it turns out something like this + 'Some text
Another one\n'
and you need something like this from a new line:
+ 'Some text\n'
+ 'Another text\ n'
Here's my code: Jsfiddle
What is the right way to set a line break in this case?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question