So the lesson goes like this " The text rendered is the text included between the opening and closing <option> tags. However, it is the value of the value attribute that is used in <form> submission (notice the difference in the text and value capitalization)."
I need to know if there was not a difference in capitalization what would be different? I tried and tested and could not see a difference. It rendered without any difference.
Hi! It already has been asked, hopefully this post will bump this topic to the top.
Why are we using <select> instead of <input> for the dropdown list? I mean if you think about it you are selecting options as well when using radio buttons, but they have the input tag. How do I know when to use what?
The <input> element does not expect any child elements to be nested inside it. This is hinted at by the fact that it is a self closing tag. <select>is expecting children, in the form of <option> tags, allowing you to provide your own list of customized options to pick from.
I think you could probably argue, well why not just have several <input> elements of type select that make the drop down instead of nesting <options>, like your radio button example, but consider that each radio button is a separate “thing” always visible on the page. You want a drop down list to be collapsed by default and only show the options when interacted with. This implementation either simplifies that process or makes it possible altogether, I’m not sure (perhaps someone else can add more insight).
As far as picking which to use, well if you want a drop down list, use <select>. It’s up to your discretion how to make the webpage, consider what makes most sense for you to use.