$(function() {
$("#all").click(function() {
$(".checkBoxClass").prop('checked', $(this).prop('checked'));
});
});
ul {
list-style: none;
margin: 0;
}
ul > li {
display: block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<ul class="sb_dropdown">
<li class="sb_filter">Filter your search</li>
<li>
<input class="chkbx" id="all" type="checkbox">
<label for="all"><strong>Show All</strong>
</label>
</li>
<li>
<input class="chkbx checkBoxClass" id="Activated" type="checkbox">
<label for="Activated">Activated</label>
</li>
<li>
<input class="chkbx checkBoxClass" id="Deactivated" type="checkbox">
<label for="Deactivated">Deactivated</label>
</li>
<li>
<input class="chkbx checkBoxClass" id="Blocked" type="checkbox">
<label for="Blocked">Blocked</label>
</li>
<li>
<input class="chkbx checkBoxClass" id="Locked" type="checkbox">
<label for="Locked">Locked</label>
</li>
</ul>
Simple .prop() problem here
$("#all").click(function () {
$(".checkBoxClass").prop('checked', $(this).prop('checked'));
});
how to add readonly + checked, all .chechboxClass is checkbox and when i click the #all id all checkboxClass is turn into checked with readonly. I think something missing in $("#all").
Update Sorry i didn't note that $("#all") is an toggle for all checkboxes