Good day guys, how do I create 2 radio button within a radio group? It's not part of a challenge...
input elements with type radio will create a button and to make them all as group so that only one is selected at a time, all radio buttons should have a name attribute with same value
name="on"></input>
<input type="radio" value="off" input name="off"></input>```
```This is my code so far, what am I missing?```
the name should have same value like <input type="radio" name="animal" value="dog" /> <input type="radio" name="animal" value="cat">
you have to also use <label>
element for text to appear near them
you can see the name for two buttons is same animal
it makes them a group
it’s not like that, because user can click on a radio which has name off
and it will be selected and this true for the radio with name on
This book i have says:
<fieldset>
<legend>Radioios</legend>
<input type="radio" id="vote_yes" name="vote" value="yes" checked>
<label for="vote_yes">Yes</label>
<br>
<input type="radio" id="vote_no" name="vote" value="no">
<label for="vote_no">No</label>
</fieldset>
Fieldset&Legend are optional
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.