对的,但是不显示
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>系好安全带,准备启航</title> <!--引入外部文件的方式--> <script src="script.js"> /*多行注释 我是多行注释! 我需要隐藏, 否则会报错哦!*/ //在页面中显示文字 //页面中弹出提示框 //单行注释 // 我是单行注释,我也要隐藏起来! </script> </head> <body> </body> </html>
document.write("系好安全带,准备启航--目标JS"); function fun(){ alert("准备好了,起航吧!"); } fun();