我有一个确认弹出对话框,我在其中传递了一个以逗号分隔的字符串的变量。
如何替换逗号并引入换行符?
我尝试使用替换。我尝试'\n'
从后端传递单独的列表。但似乎没有任何工作 - 尽管confirm()
用于测试目的的正常工作正常。
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.");
}
}