I took the original code that Brett is giving you and done something
for one of my app. This is not the best code around but this should do
what you wish:

http://myprogrammingetc.blogspot.com/2009/08/little-jquery-plug-in-to-move-and-sort.html

So you only have to include the plugin code and then code your own
sort method:

function sortByclassName(a,b){
var compA = $(a).attr('class');
var compB = $(b).attr('class');
return (compA <> compB) ? 1 : 0;
}

and call it this way:

$('ul li').sortThere($('destination'), sortByclassName);

Hope this will help you.

On 11 sep, 08:32, vsnu <rsvishnuvar...@gmail.com> wrote:
> I have a format like this
> <ul>
>    <li class="    "></li>
>     <li class="    "></li>
>    <li class="    "></li>
>    <li class="    "></li>
> </ul>
>
> I need to sort <li> tags by their class names
> Please help me !

Reply via email to