W3School TIY
编辑您的代码:
<html> <head> <script type="text/javascript"> function disp_alert() { alert("再次向您问好!在这里,我们向您演示" + '\n' + "如何向警告框添加折行。") } </script> </head> <body> <input type="button" onclick="disp_alert()" value="显示警告框" /> </body> </html>
查看结果: