• mui单选和多选框


    具体见代码:

    <!doctype html>
    <html>
    
        <head>
            <meta charset="UTF-8">
            <title></title>
            <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
            <link href="css/mui.min.css" rel="stylesheet" />
        </head>
    
        <body>
            <header class="mui-bar mui-bar-nav">
                <h1 class="mui-title">单选和多选的复选框</h1>
            </header>
            <div class="mui-content">
                <!--
                    单选复选框:一定要将其input上name属性添加相同的名
                -->
                <h5 class="mui-content-padded">性别:方式一</h5>
                <div class="mui-content-padded">
                    <form action="" class="mui-input-group">
                    <div class="mui-input-row mui-radio">
                        <label></label>
                        <!--checked:表示处于选中状态-->
                        <input type="radio" name="gender" checked id="" value="" />
                    </div>
                    <div class="mui-input-row mui-radio">
                        <label></label>
                        <input type="radio" name="gender" id="" value="" />
                    </div>
                    <!--mui-disabled:字体颜色变淡,disabled:禁止选择颜色变化(小圆点)-->
                    <div class="mui-input-row mui-radio mui-disabled">
                        <label>保密</label>
                        <input type="radio" disabled name="" id="" value="" />
                    </div>
                </form>
                </div>
                
                <!--没有mui-content-padded属性-->
                <form action="" class="mui-input-group">
                    <div class="mui-input-row mui-radio">
                        <label></label>
                        <!--checked:表示处于选中状态-->
                        <input type="radio" name="gender" checked id="" value="" />
                    </div>
                    <div class="mui-input-row mui-radio">
                        <label></label>
                        <input type="radio" name="gender" id="" value="" />
                    </div>
                    <!--mui-disabled:字体颜色变淡,disabled:禁止选择颜色变化(小圆点)-->
                    <div class="mui-input-row mui-radio mui-disabled">
                        <label>保密</label>
                        <input type="radio" disabled name="" id="" value="" />
                    </div>
                </form>
                
                
                <h5 class="mui-content-padded">性别:方式二</h5>
                <!--mui-card:该属性有圆角和阴影-->
                <div class="mui-card">
                <form action="" class="mui-input-group">
                    <div class="mui-input-row mui-radio">
                        <label></label>
                        <!--checked:表示处于选中状态-->
                        <input type="radio" name="gen" checked id="" value="" />
                    </div>
                    <div class="mui-input-row mui-radio">
                        <label></label>
                        <input type="radio" name="gen" id="" value="" />
                    </div>
                    <!--mui-disabled:字体颜色变淡,disabled:禁止选择颜色变化(小圆点)-->
                    <div class="mui-input-row mui-radio mui-disabled">
                        <label>保密</label>
                        <input type="radio" disabled name="gen" id="" value="" />
                    </div>
                </form>    
                </div>
                
                <h5 class="mui-content-padded">圆点居左mui-left</h5>
                <form class="mui-input-group">
                <div class="mui-input-row mui-radio mui-left">
                    <label>小学生</label>
                    <input type="radio" name="leibie" class="mui-radio"/>
                </div>
                <div class="mui-input-row mui-radio mui-left">
                    <label>中学生</label>
                    <input type="radio" name="leibie" class="mui-radio"/>
                </div>
                <div class="mui-input-row mui-radio mui-left">
                    <label>高学生</label>
                    <input type="radio" name="leibie" class="mui-radio"/>
                </div>
                <div class="mui-input-row mui-radio mui-left">
                    <label>大学生</label>
                    <input type="radio" name="leibie" class="mui-radio"/>
                </div>
                 <div class="mui-input-row mui-radio mui-left mui-disabled">
                    <label>保密</label>
                    <input type="radio" name="leibie" class="mui-radio " disabled/>
                </div>
                </form>
                
                 <h5 class="mui-content-padded">请选择你的学历(单选)</h5>
                <div class="mui-card">
                    <ul class="mui-table-view mui-table-view-chevron">
                        <!--
                            mui-table-view-cell:内容页相当于item
                            
                        -->
                        <li class="mui-table-view-cell">
                            <a class=" mui-navigate-right">大专</a>
                        </li>
                        <li class="mui-table-view-cell">
                            <a class=" mui-navigate-right">本科</a>
                        </li>
                        <li class="mui-table-view-cell">
                            <a class=" mui-navigate-right">研究生</a>
                        </li>
                    </ul>
                </div>
                
                 <h5 class="mui-content-padded">请选择你的学历(单选)</h5>
                <div class="mui-card">
                    <ul class="mui-table-view mui-table-view-radio" id="edu">
                        <!--
                            mui-table-view-cell:内容页相当于item
                            
                        -->
                        <li class="mui-table-view-cell">
                            <a class=" mui-navigate-right">大专</a>
                        </li>
                        <li class="mui-table-view-cell">
                            <a class=" mui-navigate-right">本科</a>
                        </li>
                        <li class="mui-table-view-cell">
                            <a class=" mui-navigate-right">研究生</a>
                        </li>
                    </ul>
                </div>
                
                <p id="tishi" class="mui-content-padded mui-text-center">你当前选择的是</p>
                <!--
                    多选复选框
                -->
                 <h5 class="mui-content-padded">多选复选框</h5>
                <form class="mui-input-group">
                <div class="mui-input-row mui-checkbox mui-left">
                    <label>JAVE</label>
                    <input type="checkbox" name="jn" class="mui-checkbox"/>
                </div>
                <div class="mui-input-row mui-checkbox mui-left">
                    <label>Web开发</label>
                    <input type="checkbox" name="jn" class="mui-checkbox" checked/>
                </div>
                <div class="mui-input-row mui-checkbox mui-left">
                    <label>Python开发</label>
                    <input type="checkbox" name="jn" class="mui-checkbox" checked/>
                </div>
                <div class="mui-input-row mui-checkbox mui-left">
                    <label>人工智能</label>
                    <input type="checkbox" name="jn" class="mui-checkbox"/>
                </div>
                <!--重点:mui-disabled、disabled-->
                 <div class="mui-input-row mui-checkbox mui-left mui-disabled">
                    <label>保密</label>
                    <input type="checkbox" name="jn" class="mui-checkbox" disabled/>
                </div>
                </form>
                
               
                
                
            </div>
            
            <script src="js/mui.min.js"></script>
            <script type="text/javascript">
                mui.init()
                var tishi=document.getElementById('tishi')
                document.getElementById('edu').addEventListener('selected',function(e){
                    console.log(e.detail.el.innerText)
                    var value=e.detail.el.innerText
                    tishi.innerText='你的学历为'+value
                    //弹框提示
                    mui.toast('你的学历为'+value,{duration:'short'})
                });
            </script>
            
        </body>
    
    </html>

  • 相关阅读:
    Ubuntu中的解压缩文件的方式 分类: Java 2014-07-20 22:33 1264人阅读 评论(0) 收藏
    Ubuntu下安装JDK图文解析 分类: Java 2014-07-20 21:28 4565人阅读 评论(3) 收藏
    数据结构和算法设计专题之---24点游戏(穷举法和递归法) 分类: Java 2014-07-18 21:26 789人阅读 评论(0) 收藏
    数据结构和算法设计专题之---单链表的逆序 分类: Java 2014-07-18 21:24 562人阅读 评论(1) 收藏
    Android中实现静态的默认安装和卸载应用 分类: Android 2014-07-02 22:43 5952人阅读 评论(19) 收藏
    Git的使用方法 分类: Java 2014-06-18 18:34 520人阅读 评论(0) 收藏
    J2EE学习篇之--JQuery技术详解 分类: JavaWeb 2014-06-18 11:35 1958人阅读 评论(1) 收藏
    MyEclipse6.0中使用aptana插件,添加jquery提示功能 分类: JavaWeb 2014-06-04 15:35 648人阅读 评论(0) 收藏
    Android中如何搭建一个WebServer 分类: Android 2014-06-01 14:44 8708人阅读 评论(3) 收藏
    J2EE学习篇之--Spring技术详解 分类: JavaWeb 2014-05-28 10:15 1109人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/Dark-fire-liehuo/p/10417834.html
Copyright © 2020-2023  润新知