1.6k views
2 votes
Add a checkbox associated with each label. The first checkbox should have name and id of "likeCats" and be initially checked. The second checkbox should have name and id of "likeDogs" and be initially not checked. SHOW EXPECTED

User Mule
by
3.5k points

1 Answer

3 votes

Answer:

<input type="checkbox" name="likeCats" value="likeCats" checked>likeCats

<input type="checkbox" name="likeDogs" value="likeDogs">likeDogs

Step-by-step explanation:

In HTML, you can add checkboxes by using the <input type="checkbox"> tag. To add it to a form where the user can submit the selection, you can encapsulate the input inside a form as in the example below:

<!DOCTYPE html>

<html>

<body>

<h1>Checkboxes:</h1>

<form action="submit">

<input type="checkbox" name="likeCats" value="likeCats" checked>likeCats

<input type="checkbox" name="likeDogs" value="likeDogs">likeDogs

</form>

</body>

</html>

User Hurda
by
3.5k points