简体   繁体   中英

value attribute on <select> tag not selecting default option

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

Perhaps i'm misunderstanding here, but given the following html:

<select value="2">
    <option value="1">Something</option>
    <option value="2">Something else</option>
</select>

I would expect "Something else" to be the default selected option. However, it does not seem to be. Why is this, and what should I be doing differently?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM