【js】关于checkbox

2 篇文章 0 订阅
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/appcan.icon.css">
        <link rel="stylesheet" href="css/appcan.control.css">
        <link rel="stylesheet" href="123456_content/css/main.css">
    </head>
    <body>

        <div id="btn1"style=" position: absolute;left:-2em;top:0em;height: 36em;background-color: black; opacity:0.5;width: 100em"></div>
        <div id="btn"style="position: absolute;left: 15%;top: 40%;width: 70%;height: 30%;background-color: #FFFFFF;border-radius: 0.5em">
            <div id="" style="width: 100%;height: 1.5em;border-radius: 0.5em;font-size: 1.2em;text-align: center;padding-top: 0.2em;font-weight: 900">
                请选择您的预算金额
            </div>
            <div id="" style=";height: 6em" >
                <div id=""style="height: 3em" >

                    <div id=""class="ub-f1" style="float: left;width: 7em;height: 3em;text-align: center">
                        <li class=" ub  bc-text ub-ac lis" data-index="0" style="">
                            <div class="checkbox umar-r" style="">
                                <input   type="checkbox" class="uabs ub-con" value="300" name="money" οnclick="chosemoney(this)">
                            </div>
                            <div class="lv_title ub-f1 marg-l ub ub-ver ut-m line1" style="color: #B07F47">
                                300
                            </div>
                        </li>
                    </div>
                    <div id=""class="ub-f1" style="float: right;width: 6.8em;height: 3em;text-align: center">
                        <li class=" ub  bc-text ub-ac lis" data-index="0" style="">
                            <div class="checkbox umar-r" style="">
                                <input   type="checkbox" class="uabs ub-con " value="600" name="money" οnclick="chosemoney(this)">
                            </div>
                            <div class="lv_title ub-f1 marg-l ub ub-ver ut-m line1" style="color: #B07F47">
                                600
                            </div>
                        </li>
                    </div>
                    <div id=""style="clear: both">

                    </div>
                </div>
                <div id="" style="height: 3em;">
                    <div id=""class="ub-f1" style="float: left;width: 7em;height: 3em;text-align: center">
                        <li class=" ub  bc-text ub-ac lis" data-index="0" style="">
                            <div class="checkbox umar-r" style="">
                                <input id="900" name="money" type="checkbox" value="900" class="uabs ub-con " οnclick="chosemoney(this)" >
                            </div>
                            <div class="lv_title ub-f1 marg-l ub ub-ver ut-m line1" style="color: #B07F47" >
                                900
                            </div>
                        </li>
                    </div>
                    <div id=""class="ub-f1" style="float: right;width: 6.8em;height: 3em;text-align: center">
                        <li class=" ub  bc-text ub-ac lis" data-index="0" style="">
                            <div class="checkbox umar-r" style="">
                                <input  type="checkbox" class="uabs ub-con "  value="1200" name="money" οnclick="chosemoney(this)">
                            </div>
                            <div class=" lv_title ub-f1 marg-l ub ub-ver ut-m line1" style="color: #B07F47" >
                                1200
                            </div>
                        </li>
                    </div>
                    <div id=""style="clear: both">

                    </div>
                </div>
            </div>
            <div id=""style=";height: 2.5em;border-top: 1px solid #888"  >

                <div id="sure" style="float: left;height: 1.7em;width: 5.5em;border-right: 1px solid #888;text-align: center;padding-top: 0.5em;font-size:1.2em ;font-weight: 900;color: #BA9163" >
                    确定
                </div>
                <div id="quxiao" style="text-align: center;padding-top: 0.5em;font-size:1.2em ;font-weight: 900;color: #939393;float: right;width: 6em;height: 2em">
                    取消
                </div>
                <div id=""style="clear: both">

                </div>
            </div>

        </div>
        <script src="js/appcan.js"></script>
        <script src="js/appcan.control.js"></script>
    </body>
    <script>
        appcan.ready(function() {
            appcan.initBounce();
            //alert(0);

        })
        ///点击事件
        var themoney=0;
        function chosemoney(v) {
            
          for(var i=0;i<$('input').length;i++){
              $('input')[i].checked=false;
              
          }
            //$('checkbox').attr('checked', false);
            v.checked=true;
           
        }

        ///
        appcan.button("#sure", "btn-act", function() {
            for(var i=0;i<$('input').length;i++){
             if( $('input')[i].checked){
                 themoney=$('input')[i].value;
                 //alert(themoney);
                 appcan.window.publish('themoney',themoney);
             }
              
          }
            
            appcan.window.publish('1',themoney);
            appcan.window.close('Assistance');
            //appcan.window.open('Releasedemand', 'Releasedemand.html', 0);
        })
        appcan.button("#btn1", "btn-act", function() {

            appcan.window.close('Assistance');

        })

    </script>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值