I have multiple elements with the attribute: data-percentage, is there a way of sorting the elements into ascending order with the lowest value first using eit
data-percentage
$('.testWrapper').find('.test').sort(function (a, b) { return $(a).attr('data-percentage') - $(b).attr('data-percentage'); }) .appendTo('.testWrapper');