Html select element send value to server without value attribute

My question is just out of curiosity, I have an HTML selection inside a form that looks like this:

<select id="new_office_location_select"  name="newList[#].Value1">
        <option>New York, US</option>
        <option>Stamford, US</option>
        <option>London, UK</option>
        <option>Sydney, AU</option>
</select>

      

when I submit the form, whichever option I choose, this value is passed to the server to my action method, although I did not set the value attribute for each option. That's fine for me, I'm glad it works without it, but don't the formula elements need a "value" attribute?

+3


source to share


1 answer


From MDN

Value



The text content of this attribute is a label that explains the option. If not defined, its default is the text of the element's content.

+7


source







All Articles