If you have an empty <select> box and then later add items to it, the "selection" (value) of the select box always seems to be set to the final item. I would expect it to be set to the first item, as it is when you first load a select box with items in it and no explicit value set.
In my case, I'd like to keep it focused on the option that says "Select..." until the user actually selects something.
Here's a small test case. I think requirebin's gatekeeper server is down so I can't post a demo.
If you have an empty
<select>
box and then later add items to it, the "selection" (value) of the select box always seems to be set to the final item. I would expect it to be set to the first item, as it is when you first load a select box with items in it and no explicit value set.In my case, I'd like to keep it focused on the option that says "Select..." until the user actually selects something.
Here's a small test case. I think requirebin's gatekeeper server is down so I can't post a demo.
Any idea what's wrong?