首页 > 教程 > 网页特效源码 > JS特效

    收藏

    查看按钮是灰色 只有勾选同意后才能查看
    2023-03-26JS特效13℃
    广告
    核心提示:查看隐藏内容按钮是灰色无动作,只有勾选同意后才能查看
    查看隐藏内容按钮是灰色无动作,只有勾选同意后才能查看
    未勾选状态

    勾选后

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>注册按钮是灰色,只有勾选同意后才能注册</title>
    </head>
    
    <body>
    <style>
    .box {margin-top:30px;padding-bottom:20px;text-align:center;}
    .vipHide {margin-top:30px;}
    </style>
    <div class="box">
    <label><input name="" type="checkbox" value="" id="viewText">同意注册协议</label>
    <button type="submit" id="viewBtn"jQuery('.vipHide').show();jQuery('.clickBtn').hide();" disabled>立即注册</button>
    <div class="vipHide" style="display:none;">
    我是隐藏的内容
    </div>
    </div>
    <script type="text/javascript" src="https://mbtxw.com/file/script/jquery-2.1.1.min.js"></script>
    <script>
    $(function(){
        var regBtn = $("#viewBtn");
        $("#viewText").change(function(){
            var that = $(this);
            that.prop("checked",that.prop("checked"));
            if(that.prop("checked")){
                regBtn.prop("disabled",false)
            }else{
                regBtn.prop("disabled",true)
            }
        });
    });
    </script>
    </body>
    </html>


    查看演示:https://sc.mbtxw.com/html/2222-1.html



 
  • 文本链接:https://mbtxw.com/Course/show.php?itemid=138
  • 文章来源:模板模板
  • 版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
标签: 内容隐藏 查看

更多>同类教程

0相关评论