Easiest way to sort a select element using Jquery
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…
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…
Recently I worked on a project where I had to pull data from an external site and populate a select on client’s website. Initially I thought it would be quite…