当前位置:网站首页 / 建站 / 正文

html输入密码后显示内容的代码

时间:2019年02月28日 | 作者 : liuhui | 分类 : 建站 | 浏览: 6089次 | 评论 0

阿里云限量代金券 | 此广告位出租25元/月

这个一个html输入密码后显示内容的代码,这个密码其实就是个摆设,通过查看源码仍旧可以看到密码,不建议放一些私密的东西,切勿将密码设置成自己其他的网络账户密码导致密码泄露的风险。

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>电脑博士</title>
</head>
<html>
    <body>

        <SCRIPT LANGUAGE="JavaScript">
            function password() 
            {
                var testV = 1;
                var pass1 = prompt('请输入密码:','');
                while (testV < 3) 
                {
                    if (!pass1)
                    history.go(-1);
                    if (pass1 == "123456") 
                    {
                        alert('密码正确!');
                        break;
                    }
                    testV+=1;
                    var pass1 =
                    prompt('密码错误!请重新输入:');
                }
                if (pass1!="password" & testV ==3)
                history.go(-1);
                return " ";
            }
            document.write(password());
        </SCRIPT>

        <div width="1000">
            <video width="1000" controls="controls">
              <source src="test/video.mp4" type="video/mp4">
            Your browser does not support the video tag.
            </video>
        </div>  

    </body>
</html>


推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信