Ok
<!-- begin snippet: js hide: false console: true babel: null babelPresetReact: false babelPresetTS: false -->
<!-- language: lang-js -->
$("#chkLoc0").click(function() {
$(".checkbox").prop('checked', $(this).prop('checked')).prop('disabled', $(this).prop('checked'));
});
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div class="form-group row" id="Location">
<div class="col">
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc0" name="Locations[0].SelectedSection" value="1" />
Any <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc1" name="Locations[0].SelectedSection" value="2" />
Test1 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc2" name="Locations[0].SelectedSection" value="3" />
Test2 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc3" name="Locations[0].SelectedSection" value="4" />
Test3 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc4" name="Locations[0].SelectedSection" value="5" />
Test4 <br />
</label>
</div>
<!-- end snippet -->
Just use `props` inside a `click` event for Any, finding the other checkboxes and change their properties based on the checked property.
<!-- begin snippet: js hide: false console: true babel: false babelPresetReact: false babelPresetTS: false -->
<!-- language: lang-js -->
$("#chkLoc0").click(function() {
$("#chkLoc1, #chkLoc2, #chkLoc3, #chkLoc4").prop('checked', $(this).prop('checked')).prop('disabled', $(this).prop('checked'));
});
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div class="form-group row" id="Location">
<div class="col">
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc0" name="Locations[0].SelectedSection" value="1" />
Any <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc1" name="Locations[0].SelectedSection" value="2" />
Test1 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc2" name="Locations[0].SelectedSection" value="3" />
Test2 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc3" name="Locations[0].SelectedSection" value="4" />
Test3 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc4" name="Locations[0].SelectedSection" value="5" />
Test4 <br />
</label>
</div>
<!-- end snippet -->
Example with class:
<!-- begin snippet: js hide: false console: true babel: false babelPresetReact: false babelPresetTS: false -->
<!-- language: lang-js -->
$("#chkLoc0").click(function() {
$(".checkbox").prop('checked', $(this).prop('checked')).prop('disabled', $(this).prop('checked'));
});
<!-- language: lang-html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div class="form-group row" id="Location">
<div class="col">
<label class="checkbox-inline">
<input type="checkbox" id="chkLoc0" name="Locations[0].SelectedSection" value="1" />
Any <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc1" name="Locations[0].SelectedSection" value="2" />
Test1 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc2" name="Locations[0].SelectedSection" value="3" />
Test2 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc3" name="Locations[0].SelectedSection" value="4" />
Test3 <br />
</label>
<label class="checkbox-inline">
<input type="checkbox" class="checkbox" id="chkLoc4" name="Locations[0].SelectedSection" value="5" />
Test4 <br />
</label>
</div>
<!-- end snippet -->