Radios & Checks
Here's an example of including checkboxes and radio buttons within a <form> element, ensuring each input has unique identifiers (id attributes) and appropriate labels:

<form>
<div class="mb-3">
<label for="checkbox1" class="form-check-label">Default checkbox</label>
<input type="checkbox" id="checkbox1" class="form-check-input" />
</div>
<div class="mb-3">
<label for="checkbox2" class="form-check-label">Default checkbox (checked)</label>
<input type="checkbox" id="checkbox2" class="form-check-input" checked />
</div>
<div class="mb-3">
<label for="checkbox3" class="form-check-label">Default checkbox (disabled)</label>
<input type="checkbox" id="checkbox3" class="form-check-input" disabled />
</div>
<div class="mb-3">
<label for="radio1" class="form-check-label">Default radio button 1</label>
<input type="radio" id="radio1" name="radioGroup" class="form-check-input" />
</div>
<div class="mb-3">
<label for="radio2" class="form-check-label">Default radio button 2 (checked)</label>
<input type="radio" id="radio2" name="radioGroup" class="form-check-input" checked />
</div>
<div class="mb-3">
<label for="radio3" class="form-check-label">Default radio button 3 (checked and disabled)</label>
<input type="radio" id="radio3" name="radioGroup" class="form-check-input" checked disabled />
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>

Explanation:
Last updated