P
P
Peter2015-10-21 15:57:39
JavaScript
Peter, 2015-10-21 15:57:39

How to make a line break without resorting to a tag?

If you pass a tag, then the arrow parser transforms < and > As a consequence, it is displayed in the text.
How to make a line break in the text without using a tag, but with javascript available?
Of course, I can calculate the length of each substring, teach the element access to all lines, "cut" in the right places and substitute a tag there, but there may be another solution.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GreatRash, 2015-10-21
@GreatRash

You can insert into the text:
But in fact it is no different from:
<br />

I
Ivanq, 2015-10-21
@Ivanq

CSS: white-space: pre-wrap

N
ndbn, 2015-10-21
@ndbn

nl2br(js)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question