How to display text from textarea.value in browser with line breaks entered?
Hello comrades. The page has a form with a textarea inside, and a container for rendering messages "sent" from this textarea. Line breaks are available in the textarea (press Enter / Shift + Enter - the cursor will move to a new line and all gaps will be displayed inside the textare). But when these messages are rendered to the page, all hyphenation disappears, and the content is displayed on one line. How to preserve all line breaks in general so that they appear on the page in the container as in the textarea?
Does it work here interestingly?
Just apply the white-space: pre-wrap;
property to the div block where the CSS text is inserted
The simplest optionAnonymous
To place the code, please use CodePen or similar tool. Thanks you!