 <p>This just happened to me... exactly. I needed to change it to <code>\\n</code> instead of <code>\n</code>.</p> <pre><code>alert("Hello again! This is how we"+"\\n"+"add line breaks to an alert box!"); </code></pre>