+ 4

Is this code right?

<input type="radio" name="select" value="yes"> Si <br /> Is a yes or no question, I'm confused what should I write in the name attribute

25th Feb 2022, 2:30 AM
Daniela
Daniela - avatar
2 Answers
+ 5
Later on, after you learned about form data submission you will understand that 'name' attribute is used as key, and 'value' is used as data. These pairs of a key-value pair are sent to back-end code for data processing in such format "key=value". So if you submit the form where that radio button was placed in, the information sent to back-end machine may look like "select=yes" And it's a good idea to use meaningful word when you set 'name' attribute for an element.
25th Feb 2022, 3:08 AM
Ipang
+ 3
Ipang Thank you, I'm getting it little by little
25th Feb 2022, 3:45 AM
Daniela
Daniela - avatar