源代码:
<!DOCTYPE html> <html> <body> <p>Click the button to demonstrate line-breaks in a popup box.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { alert("Hello\nHow are you?"); } </script> </body> </html>
测试结果:
wowef.com
- 在线测试