相关疑难解决方法(0)

检查是否选中了JQuery mobile复选框

我有一个复选框列表,我想获得每个复选框的状态.清单在这里:

<div data-role="fieldcontain">
    <fieldset data-role="controlgroup">
       <input type="checkbox" name="Sunday" id="Sunday-1" class="custom" />
       <label for="Sunday-1">Sunday</label>
       <input type="checkbox" name="Monday" id="Monday-1" class="custom" />
       <label for="Monday-1">Monday</label>
       <input type="checkbox" name="Tuesday" id="Tuesday-1" class="custom" />
       <label for="Tuesday-1">Tuesday</label>
  </fieldset>
</div>
Run Code Online (Sandbox Code Playgroud)

我通常使用此引号检查复选框的状态:

var isChecked = $('#CheckboxID').is(':checked');

但在我的情况下,是否有一种方法可以立即获取"Jquery Mobile"复选框的状态?

javascript checkbox jquery jquery-mobile

8
推荐指数
1
解决办法
3万
查看次数

如何选择或取消选择JQuery Mobile中的所有复选框?

我有几个可折叠的复选框,我正在尝试检查/取消选中该部分中的所有框.

HTML

目前,当我单击主复选框时,它只是打开并关闭可折叠对话框.

<li data-role="collapsible" id="educationlayers">
            <h3>
                <input type="checkbox" name="education" id="education" class="layers"/>
                <label for="education">Education</label>
            </h3>
            <fieldset data-role="controlgroup">
                <input type="checkbox" data-mini="true" name="education" id="daycare" class="layers"/>
                <label for="daycare">Day Care</label>
                <input type="checkbox" data-mini="true" name="education" id="elementary" class="layers"/>
                <label for="elementary">Elementary</label>
                <input type="checkbox" data-mini="true" name="education" id="intermediate" class="layers"/>
                <label for="highschool">High School</label>
                <input type="checkbox" data-mini="true" name="education" id="postsecondary" class="layers"/>
                <label for="postsecondary">Post Secondary School</label>
            </fieldset>
         </li> 
         <li data-role="collapsible" id="emergencylayers">
               <h3>
                    <input type="checkbox" name="emergency" id="emergency" class="layers"/>
                    <label for="emergency">Emergency</label>
                </h3>
                <fieldset data-role="controlgroup">
                    <input type="checkbox" data-mini="true" name="emergency" id="ambulance" class="layers"/>
                    <label for="ambulance">Ambulance Station</label>
                    <input type="checkbox" …
Run Code Online (Sandbox Code Playgroud)

checkbox jquery selectall unselect jquery-mobile

2
推荐指数
1
解决办法
9677
查看次数

-2
推荐指数
3
解决办法
1万
查看次数