1<div>
2 <input type="checkbox" id="scales" name="scales"
3 checked>
4 <label for="scales">Scales</label>
5</div>
6
7<div>
8 <input type="checkbox" id="horns" name="horns">
9 <label for="horns">Horns</label>
10</div>
1<!-- Add checked tag -->
2<input type="checkbox" name="vehicle3" value="Boat" checked>
1<input type="checkbox" name="agreement" value="ok" checked>
2<label for="ok">I agree</label>
1<input type="checkbox" name="vehicle3" value="Boat" checked>
2
3#If if helps you give it Thumbs up
1<!--
2 You can also group multiple checkboxes by giving them the same "name".
3 When posted to PHP, all the checked boxes' values will appear in the
4 $_POST array under an index with the same name as your checkboxes.
5
6 E.g. if we check "bananas" and "apples" below and post the form then
7 our $_POST array will look something like this:
8 ['fruit' => ['bananas', 'apples']]
9-->
10<form>
11 <label>
12 <span>Bananas</span>
13 <input type="checkbox" name="fruit[]" value="bananas">
14 </label>
15
16 <label>
17 <span>Apples</span>
18 <input type="checkbox" name="fruit[]" value="apples">
19 </label>
20
21 <label>
22 <span>Grapes</span>
23 <input type="checkbox" name="fruit[]" value="grapes">
24 </label>
25
26 <button type="submit">Submit</button>
27</form>
1 <input type="checkbox" checked={props.completed} />
2
3#for props completed is true/false , hence if completed is false then checkbox will not be clicked .
4# if the checkbox is true it will be will be checked
5