Question about radio buttons in html

Question about radio buttons in html
0

#1

Can i put multiple input type of radio with names in single label or i have to create each label for one radio button?


#2

I don’t quite understand your question. But if the standard HTML radio button won’t handle it, you can just create your own radio button functionality with JS and have it do whatever you want.


#3

What i mean is can we put two or more radio buttons in single label element? Im learning HTML and i passed the code where i had to make radio buttons so i wonder if in order to make two or more radio buttons do we need to use one label element for example: < label > < input type= " radio " name= " indoor-outdoor “>indoor < input type= " radio " name= " indoor- outdoor”> outdoor</ label > or we need to make new label for outdoor (as an example), because in challenge in order to pass we had to copy paste already written label element and only rename from indoor to outdoor so im curious if we can use both indoor and outdoor without having to make new label for outdoor for example. I hope you undrestand. Thanks.


#4

Well, the label is how you know what the radio button you’ve selected is. But if you want to keep your user in suspense, you can leave the labels off.