Answers for "check checkbox by clicking on label"

1

html checkbox label clickable

// Use "for" to click in "label"
<input type="checkbox" name="checkbox" id="checkbox_id" value="value">
<label for="checkbox_id">Text</label>
Posted by: Guest on June-08-2021
0

only one of my checkboxes will check if i click on its label

<div>
    <label for="group">
        Select lists
    </label>
</div>
<div>
    <input type="checkbox" name="group" id="group1" value="1" title="Main List" />
    <label for="group1">Main List</label>
    <input type="checkbox" name="group" id="group2" value="2" title="Secondary List" />
    <label for="group2">Secondary List</label>
</div>
Posted by: Guest on December-01-2020

Browse Popular Code Answers by Language