---
title: "How to force a line break on a Javascript concatenated string?"  
description: "How to force a line break on a Javascript concatenated string?"  
author: "Takeshi Okada"  
published: 2013-03-12  
updated: 2013-03-12  
canonical: https://www.mindstick.com/forum/654/how-to-force-a-line-break-on-a-javascript-concatenated-string  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How to force a line break on a Javascript concatenated string?

Hi All!

I'm sending [variables](https://www.mindstick.com/articles/715/php-variables) to a [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) box as a concatenated [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) so I can include [multiple](https://www.mindstick.com/blog/12797/iowa-is-expected-to-see-heavy-growth-in-multiple-sectors) variables in on getElementById call.

I need to specify a line break so the address is formatted properly.

document.getElementById("address_box").value = \
([title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars) + address + address2 + address3 + address4);\
I've [already](https://yourviews.mindstick.com/view/88453/the-hidden-ways-ai-is-already-controlling-your-daily-life) tried \n after the line break and after the variable. and tried changing the [concatenation](https://www.mindstick.com/forum/34153/how-to-write-program-to-file-concatenation-program-in-java-i-o) [operator](https://www.mindstick.com/blog/144/union-intersection-and-except-operator-in-sql-server) to +=.

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Takeshi!

Try this way

document.getElementById("address_box").value = \
(title + "\n" + address + "\n" + address2 + "\n" + address3 + "\n" + address4);


---

Original Source: https://www.mindstick.com/forum/654/how-to-force-a-line-break-on-a-javascript-concatenated-string

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
