显示带有折行的对话框

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function disp_alert()
  5. {
  6. alert("再打个招呼。这里演示了" + "\n" + "如何在消息框中添加折行。")
  7. }
  8. </script>
  9. </head>
  10. <body>
  11.  
  12. <input type="button" onclick="disp_alert()" value="显示消息框" />
  13.  
  14. </body>
  15. </html>