請問我的代碼哪里錯了,為什么點按鈕沒反應(yīng)呢
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全帶,準(zhǔn)備啟航</title>
<script type="text/javascript">
function dui(){
? ? var a=confirm("準(zhǔn)備好了嗎?");
? ? ? ? if (a==true)
? ? ? ? {
? ? ? ? document.write("準(zhǔn)備好了"); ? ?
? ? ? ? }
? ? ? ??
? ? ? ? else
? ? ? ? {
? ? ? ? document.write("沒準(zhǔn)備好");
? ? ? ? }
? ? }
</script>
</head>
<body>
<input type="button" value="請點擊我" onclick="dui()">
</input>
</body>
</html>
2016-09-11
var a=confirm("準(zhǔn)備好了嗎?");?? //此處的分號用的是中文分號
? ? ? ? if (a==true)
? ? ? ? {
? ? ? ? document.write("準(zhǔn)備好了"); ? ?//此處的分號用的也是中文分號
? ? ? ? }
以上兩處分號改為英文分號就好了
2016-09-11
不能使用中文分號
2016-09-11
? document.write("沒準(zhǔn)備好")后面是中文分號,在編碼中禁止使用中文符號。
2016-09-11
? document.write("沒準(zhǔn)備好")后面是中文分號,在編碼中禁止使用中文符號。
2016-09-11
你的? ? var a=confirm("準(zhǔn)備好了嗎?")后面的';'以及? ? document.write("準(zhǔn)備好了")后面的';'寫成了中文的,用英文狀態(tài)下的輸入法就行了。?