I need to sort some elements depend on it attribute. For an example:
<div id="sort">
<div n="1"></div>
<div n="2"></div>
<div n="3"></div>
<div n="4"></div>
</div>
And array_num
{3, 2, 1, 4}
pseudo code:
$('#sort').sort(array_num, 'n');
results will be:
<div id="sort">
<div n="3"></div>
<div n="2"></div>
<div n="1"></div>
<div n="4"></div>
</div>