Using a simple <select>
list with many <option>
elements, I am trying to get the selected option to show up at the top of the select list (it currently shows up at the bottom when the list is shown again).
My environment is using bootstrap and jQuery but we're not interested in other third party code if we can avoid it. Solution must work in Chrome and Safari - but the more support the better.
EDIT:
As requested, here's an example using a simple <select>
list with many <option>
elements.
- Click on the dropdown to show the list of options.
- Click on number option 25.
- Click on the dropdown to show the list of options again.
- Notice that the selected option is shown at the bottom of the list.
- Recall that I am trying to get the selected option to show up at the top of the select list when list is shown again.
EDIT 2: The motivation is to make it easier for the user to select the next item in the list. Currently they have to scroll down then click the next item, but ideally they wouldn't have to scroll in order to select the most likely 'next to select' item.
<select id="example">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
</select>