zoukankan      html  css  js  c++  java
  • mui——checkbox复选框状态绑定

    效果展示:

    HTML

    <div class="mui-input-row">
                    <span class="mui-left mui-checkbox radio-box">
                        <label>张元</label>
                        <input name="checkbox" value="Item 1" type="checkbox">
                    </span>
                    <span class="mui-left mui-checkbox radio-box">
                        <label>李梓熙</label>
                        <input name="checkbox" value="Item 1" type="checkbox">
                    </span>
                    <span class="mui-left mui-checkbox radio-box">
                        <label>王晓霞</label>
                        <input name="checkbox" value="Item 1" type="checkbox">
                    </span>
                    <span class="mui-left mui-checkbox radio-box">
                        <label>上官欧</label>
                        <input name="checkbox" value="Item 1" type="checkbox">
                    </span>
                    <span class="mui-left mui-checkbox radio-box">
                        <label>陈玉燕</label>
                        <input name="checkbox" value="Item 1" type="checkbox">
                    </span>
                </div>

    JS

    <script type="text/javascript">
                mui.init();
                mui('.mui-input-row').on('change', 'input', function() {
                    var value = this.checked?"true":"false";
                    if(this.checked){
                        document.getElementById('touPiaoBtn').style.background = '#40C36B';
                    }else{
                        document.getElementById('touPiaoBtn').style.background = '#96E7B1';
                    }
                });
            </script>
  • 相关阅读:
    LCA最近公共祖先Tarjan(离线)
    51nod 1135 原根
    51nod 1134最长递增子序列
    51nod 1130 斯特林公式
    51nod 1186 Miller-Rabin素数测试
    51Nod 1257 背包问题 V3
    另类求组合数
    Gym
    msp430项目编程45
    msp430项目编程44
  • 原文地址:https://www.cnblogs.com/cqiong/p/13651321.html
Copyright © 2011-2022 走看看