JSFiddle - React, Tailwind, and code Playground
JavaScript
function sortByName(htmllist) {
$LIST=htmllist.children();
$LIST.sort(function(a,b){
return ( ( $(a).attr('id') > $(b).attr('id')) ? 1 : -1);
})
return $LIST;
} // end function sortByName()
var data = [{ top_en: "Vehicles",
top_tran: "Veh"},
{ top_en: "Estate",
top_tran: "Est"},
{ top_en: "High-Tech",
top_tran: "Hig"}];
$( function(){
$lis=$('<p/>');
$.each(data, function(key, item){
$lis.append( '<li id="'+item.top_tran+'">'+item.top_en+'</li>');
});
$('#res').append( sortByName($lis) );
})