为了账号安全,请及时绑定邮箱和手机立即绑定

请问代码那有问题?

<!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>


正在回答

5 回答

可能是线路的问题,或者是你浏览器的设置。

bqgnvftukyj

0 回复 有任何疑惑可以回复我~
document.write("准备好,起航吧");
document.write("ssssswandanle ");

这2行最后的分号改为英文的分号

 document.write("准备好,起航吧");
 document.write("ssssswandanle ");
<input type="button" onclick="go" value="点击">

这里调用函数缺了()

<input type="button" onclick="go()" value="点击">

完整代码

<!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>


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

请问代码那有问题?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信