line break introduction in confirm message string
<p>I have a confirmation pop-up dialog in which I am passing a variable which is a comma separated string.</p>

<p>How can I replace the commas and introduce a line break?</p>

<p>I tried using replace. I tried passing <code>'\n'</code> separated list from back-end. But nothing seems to work — though a normal <code>confirm()</code> used for testing purposes is working fine.</p>

<pre><code>var listcontrol = document.getElementById(id3);
var List = listcontrol.innerText;
var finallist = List.replace("\n", "\n");

if (checkboxCell.checked == false) {
    if (labelCell.innerText == "Yes") {
        confirm("The selected exam is present in the following certifications: " + "\n" + finallist + "\n" +
        "Uplanning this exam here would unplan the same exam under other certification(s) also.");
    }
}
</code></pre>
