I want to set a option that was selected previously to be displayed on page load. I tried it with the following code:

$("#gate").val('Gateway 2');

with

<select id="gate">
    <option value="null">- choose -</option>
    <option value="gateway_1">Gateway 1</option>
    <option value="gateway_2">Gateway 2</option>
</select>

But this does not work. Any ideas?

16 Answers
16

Leave a Reply

Your email address will not be published. Required fields are marked *