zoukankan      html  css  js  c++  java
  • js勾选checkbox,按钮可按

    主要实现jquery方法,勾选checkbox后按钮变色并且除去disabled

     $(function () {
            $('.pricing-box').click(function () {
                $(this).addClass("select").siblings().removeClass("select");
            })
            $(".agree-choose input[type='checkbox']").change(function () {
    
                if ($(this).is(':checked')) {
                    $("#submit-btn").removeClass("disabled");
                } else {
                    $("#submit-btn").addClass("disabled");
                }
    
            })
        })
    <div class="agree-service-wrap">
                    <input type="checkbox" name="enableDiscount" class="price-factor hide">
                    <div class="agree-choose pull-right checkbox">
                        <label>
                            <input id="agree-choose" name="agree-choose" type="checkbox" class="ace">
                            <span class="lbl"> <span class="agree-use">我已阅读并同意签署</span><a href="" target="_blank">《服务协议》</a></span>
                        </label>
                    </div>
                </div>

    <footer class="order-price pull-right"><input type="hidden" name="costTotal" class="cost-total" value="0">
      <div class="price-total">
      <span class="price-label">总计:</span><span class="price">¥ 2490</span>
         <p>购买后店铺可容纳10个成员</p>
         <p> 到期时间为2018年5月22日</p>
       </div>
      <div class="order-submit"><a id="submit-btn" href="payment-order.html" type="button" class="btn btn-primary disabled btn-round">提交订单</a></div>
    </footer>
  • 相关阅读:
    node 使用笔记
    体会 git 之优越性
    Notes for building gimp-print
    Selenium Books
    Using MongoDB in C#
    Learning coding online
    USING NHIBERNATE WITH MySQL
    Data Visualization Books
    Web Automation with Selenium (C#)
    Gearman In Action
  • 原文地址:https://www.cnblogs.com/silences/p/7154980.html
Copyright © 2011-2022 走看看