html radio

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

<label for="animal"><input type="radio" name="id="animal">Puppy</label>
<label for="animal"><input type="radio" name="id="animal">Cat</label>

Even if I click on a cat, the dog is selected, so how do I modify it? You want to be selected when you click on a letter.

html input label

2022-09-20 11:15

1 Answers

Assign id and for separately.

for="dog" id="dog"
for="cat" id="cat"

2022-09-20 11:15

If you have any answers or tips

© 2022 pinfo. All rights reserved.