# How to Add a 'new line' to output stream ?

**URL:** https://forum.kirupa.com/t/how-to-add-a-new-line-to-output-stream/657579
**Category:** Uncategorized
**Created:** [March 15, 2023, 5:36pm UTC](https://forum.kirupa.com/t/how-to-add-a-new-line-to-output-stream/657579 "2023-03-15T17:36:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)
#### Post date: [March 15, 2023, 5:36pm UTC](https://forum.kirupa.com/t/how-to-add-a-new-line-to-output-stream/657579/1 "2023-03-15T17:36:30Z")

</div>

Hello ,  
I am printing my webpage with .js ,  
and I want to force a new line after each printed object .

```auto
                    for (var i = 0; i < copyFrom.length; i++) {
                      MyDiv[i].style.display = "none";
                      collectedTextareas = collectedTextareas + copyFrom[i].value;
/*					  
					  collectedTextareas = collectedTextareas = + " 
";
*/
                     }

```

Above I tried to just copy a blank line ending with “Enter-key” , it runs fine But doesn’t cause ‘new line’ .  
Is there a Hex-value I could put in output stream ?  
[https://vmars.us/freeware/FreshDraft/FreshDraft–03.15.23.html](https://vmars.us/freeware/FreshDraft/FreshDraft--03.15.23.html)  
Thanks for your Help…

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [March 15, 2023, 7:34pm UTC](https://forum.kirupa.com/t/how-to-add-a-new-line-to-output-stream/657579/2 "2023-03-15T19:34:22Z")

</div>

At the location you are specifying the string to insert, add the `\r\n` characters for a line break:

```auto
myTextArea.value += text + '\r\n';

```

🙂

---

<div class="post-metadata">

### Author: ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)
#### Post date: [March 16, 2023, 4:50pm UTC](https://forum.kirupa.com/t/how-to-add-a-new-line-to-output-stream/657579/3 "2023-03-16T16:50:34Z")

</div>

Ah , perfect , Thanks  
[https://vmars.us/freeware/FreshDraft/FreshDraft.html](https://vmars.us/freeware/FreshDraft/FreshDraft.html)

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [March 16, 2023, 5:44pm UTC](https://forum.kirupa.com/t/how-to-add-a-new-line-to-output-stream/657579/4 "2023-03-16T17:44:12Z")

</div>

If you want to get more fancy in the future, then you can do something similar to what I describe here 🙂

> **[Quickly Adding Many Elements into the DOM](https://www.kirupa.com/javascript/quickly_inserting_elements_dom.htm)**
>
> Learn two fast approaches for quickly going from data to a boatload of DOM elements that we can see!
