{"id":867,"date":"2022-02-03T10:21:18","date_gmt":"2022-02-03T10:21:18","guid":{"rendered":"https:\/\/mklasen.com\/?p=867"},"modified":"2022-02-03T10:22:40","modified_gmt":"2022-02-03T10:22:40","slug":"re-order-options-in-a-select-element","status":"publish","type":"post","link":"https:\/\/mklasen.com\/re-order-options-in-a-select-element\/","title":{"rendered":"Re-order options in a select element"},"content":{"rendered":"\n

While working on a feature that allows users to move options from one select element to another I ran into an issue with alphabetic order. Especially when multiple options are being moved at once.<\/p>\n\n\n\n

To easily solve this I wrote a re-order function that orders both select elements at once.<\/p>\n\n\n\n

The code’s hosted on Github gists, embedded below:<\/p>\n\n\n\n