jQuery option reordering
Doing what jQuery does best

July 24, 2017
posted 2 months ago

tagged

The purpose of this code is to select an option item in a select based on value, and move it to the second item in the select’s option order. The first item serves as a label for the form field.

In my case, the options are coming out of a database, and are subject to change as far as order and the number of items available. However, the value will not change, so this is a guaranteed, permanent hook for what needs to be done here.

After working on a solution, I came up with this code: