以下代碼的問題是什么?求解答
有2個(gè)問題:
“document.write("系好安全帶,準(zhǔn)備起航--目標(biāo)JS");”不顯示;
點(diǎn)擊按鈕后無彈出框。我實(shí)在找不到原因,向慕粉求助。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全帶,準(zhǔn)備啟航</title>
<!--引入外部文件的方式-->
<script type="text/javascript" >
document.write("系好安全帶,準(zhǔn)備起航--目標(biāo)JS");
?? ?
//頁面中彈出提示框
function sh(){
??? var text=confirm("真的準(zhǔn)備好了嗎?");
?? ?
??????? if (text==true){
?????????? ?
??????????? document.write("起航了");
??????? }
?????? ?
??????? else{docmuent.write("請(qǐng)系安全帶");}
??? }
</script>
</head>
<body>
?
<input type="button" value="請(qǐng)點(diǎn)擊我" onclick="sh()">
?? ?
</body>
</html>
2017-05-09
document.write("起航了");
你這段代碼最后是中文符號(hào),改成英文符號(hào)就對(duì)了