請問代碼那有問題?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全帶,準備啟航</title>
<!--引入外部文件的方式-->
<script type="text/javascript">
? ? function go()
? ? {
? ? ? ? var zou=confirm("點擊");
? ? ? ? if (zou==true)
? ? ? ? {
? ? ? ? ? ? document.write("準備好,起航吧");
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? document.write("ssssswandanle ");
? ? ? ? }
? ? ? ??
? ? ? ??
? ? ? ? }
</script>
</head>
<body>
? ? <input type="button" onclick="go" value="點擊">
? ? </input>
</body>
</html>
2015-06-18
document.write("準備好,起航吧"); document.write("ssssswandanle?");這2行最后的分號改為英文的分號
?document.write("準備好,起航吧"); ?document.write("ssssswandanle?");這里調用函數缺了()
完整代碼
<!DOCTYPE?HTML> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>系好安全帶,準備啟航</title> <!--引入外部文件的方式--> <script?type="text/javascript"> ????function?go() ????{ ????????var?zou=confirm("點擊"); ????????if?(zou==true) ????????{ ????????????document.write("準備好,起航吧"); ????????} ????????else{ ????????????document.write("ssssswandanle?"); ????????} ??????? ?????} </script> </head> <body> ????<input?type="button"?onclick="go()"?value="點擊"> ????</input> </body> </html>