html radio

Asked 1 years ago, Updated 1 years ago, 96 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


© 2024 OneMinuteCode. All rights reserved.