Sorting dropdown list using Javascript

前端 未结 7 903
孤城傲影
孤城傲影 2020-11-27 17:02

i want to sort the drop down items using javascript,can anyone tell me how to do this.

相关标签:
7条回答
  • 2020-11-27 17:55

    Put the option values and text into an array, sort the array, then replace the existing option elements with new elements constructed from the sorted array.

    0 讨论(0)
提交回复
热议问题