Hi I have a html select tag like this:
<select name = "options>
<option value = "235">apples</option>
<option value = "264">oj</option>
<option value = "133">banana</option>
</select>
If I do it like this, when the page first loads, it will show apples.
However, the value of options might already be set. The value might be set to oj. In that case, I want to show oj instead of apples.
Also, if I select oj and I refresh the page, it will show apples again instead of oj.
How do I fix this?
Use
selectedattribute:<option value="264" selected="selected">oj</option>