If you are using jquery sorting a select element is quite easy. Check the below code.
$(“#select-id”).html( $(“#select-id option”).sort(function (a, b) {
return a.text == b.text ? 0 : a.text < b.text ? -1 : 1;
}));
learnings, photography, travel, adventures, passions, life etc...
If you are using jquery sorting a select element is quite easy. Check the below code.
$(“#select-id”).html( $(“#select-id option”).sort(function (a, b) {
return a.text == b.text ? 0 : a.text < b.text ? -1 : 1;
}));