JSFiddle - React, Tailwind, and code Playground
HTML
<select id="mySelect"></select>
JavaScript
var json = {"1":"First","11":"Second","10":"Third"};
var list = new Array();
// insert all the properties and their values into an array of objects
for(var propName in json) {
list.push({ "id": propName, "value":json[propName] });
}
// sort the array using the value instead of the id
list.sort(function compare(a,b) {
if (a.value < b.value)
return -1;
else
return 1; // we consider that if they have the same name, the first one goes first
});
// append the options in order in the select
for (var x = 0; x < list.length; x++) {
$("#mySelect").append("<option value='" + list[x].id + "'>" + list[x].value + "</option>");
}