演示在警告框中换行

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>JavaScript</h1>
  6.  
  7. <p>在警告框中换行。</p>
  8.  
  9. <button onclick="alert('Hello\nHow are you?')">试一试</button>
  10.  
  11. </body>
  12. </html>