Javascript实例
1、Javascript消息框 (1)Alert(警告)框 (2)带有换行的警告框 < ! DOCTYPE html > < html > < head > < meta charset = "utf-8" > < title > JavaScript的使用 < / title > < / head > < body > < p > 点击按钮在弹窗总使用换行。 < / p > < button onclick = "myFunction()" > 点我 < / button > < p id = "demo" > < / p > < script > function myFunction ( ) { alert ( "Y\nHow are you?" ) ; } < / script > < / body > < / html > (3)确认框 < ! DOCTYPE html > < html > < head > < meta charset = "utf-8" > < title > Javascript的使用 < / title > < / head > < body > < p > 点击按钮,显示确认框。 < / p > < button onclick = "myFunction()" > 点我 < / button > < p id = "demo" > < / p