document.writeln("Premium ticket cost is " + calcBaseCost("premium", numTickets, baseTicketPrice));
document.writeln("Standard ticket cost is " + calcBaseCost("standard", numTickets, baseTicketPrice));
document.writeln("Budget ticket cost is " + calcBaseCost("budget", numTickets, baseTicketPrice));
尝试<p> </ p>
但无济于事
答案 0 :(得分:0)
添加<br/>
所以
document.writeln("Premium ticket cost is " + calcBaseCost("premium", numTickets, baseTicketPrice) + "<br/>");
并为其他所有人做到这一点。
虽然我建议您不要使用document.writeln,而是将结果写入div
<div id='results'></div>
然后
document.getElementById('results').innerHTML = "blablabla...";
如果我有帮助,请点击复选标记,将我的答案标记为正确。感谢。