Is it possible to sort the list bellow from the lower number to the bigger number, keeping each li content?
39 <
Your function should be like this.
function numOrdDesc(a, b) { var aTxt = parseInt($(a)[0].innerText, 10); var bTxt = parseInt($(b)[0].innerText, 10); return (bTxt - aTxt); }
DEMO