如何在警告框中的变量之间进行换行?

时间:2018-02-16 16:50:12

标签: javascript

目前我有 window.alert('错误答案'+为什么+''+引用); 我可能应该使用模态,但使用警告框更容易

1 个答案:

答案 0 :(得分:0)



var why, cite;
window.alert("Wrong Answer \n" + why + "\n" + cite);