這樣寫為什么按鈕沒有反應(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">
document.write("系好安全帶,準(zhǔn)備啟航--目標(biāo)JS");
function:con()
{
? var mychar=confirm("準(zhǔn)備好了嗎") ?
if (mychar==true)
{
? ?document.write("gongxini");
}
else?
{document.write("sb");}} ??
</script>
</head>
<body>
<input type="button" value="dianwo" onclick="con()">
</body>
</html>
2016-03-05
代碼問題比較多,除了樓上兩位說的,你的引號(hào)也有問題,應(yīng)該是英文引號(hào)
2016-02-13
function:con()
這個(gè)地方的”:“去掉換成空格就好了
2016-02-10
定義函數(shù):function con()??? 沒有冒號(hào);
定義變量mychar那句沒加分號(hào)