I have a drop down list’s select tag that looks like this:
<select name="MyName" id="MyID">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<option>Option 4</option>
</select>
When the user enters the control and selects an option, that option becomes the one that remains visible in the drop-down text when the drop-down box loses its focus. How can I make an option the value that’s displayed when the page loads? For the moment, when the page is displayed, the text shows the first option but what if I’d like to show option 4 on load?
Thanks for suggestions.
Use the attribute selected. To select the third option:
To use Jquery to find the selected item: