qSort plugin - Demo

Here is a list of "div" to be sorted. We will sort these div based on their attribute "value".
11 - John - The id of this div is "a"
10 - Albert - The id of this div is "g"
1 - Alvin - The id of this div is "c"
13 - girard - The id of this div is "b"
7 - Tim - The id of this div is "e"
6 - Gates - The id of this div is "z"
13 - Larry - The id of this div is "k"
17 - Steve - The id of this div is "m"
15 - Eric - The id of this div is "d"
Alpha sort will treat the numbers as string, which results in 1, 11, 6, 7 in ascending order, while numeric sort will sort treating numbers as numbers.
Here is an example for sorting the options in the drop down.
<--- Options have been sorted.

Documentation - How to use

Plain sorting - $(".sortDiv").qsort(); If no attributes are specified, defaults to "value" attribute.
Plain sorting on attribute "id" - $(".sortDiv").qsort({attr: "id"});
Plain sorting on attribute "username" - $(".sortDiv").qsort({attr: "username"});
Plain sorting on attribute "username" - $(".sortDiv").qsort({attr: "username", ignoreCase: true});
Plain sorting on attribute "username" descending - $(".sortDiv").qsort({attr: "username", order: "desc"});
Plain numeric sorting - $(".sortDiv").qsort({digits: true});
Plain sorting with descending - $(".sortDiv").qsort({order: "desc"});
Plain numeric sorting with descending - $(".sortDiv").qsort({digits: true, order: "desc"});

Download

Click here to download the compressed version.

Click here to download the uncompressed version.