Her is my html and jQuery. I want the ability to sort them alphabetic by class name when I press the "Sort" "button" in the filter div. Right now I can hide all others by "green" all others will hide. But but I need the ability to sort them.
<div id='filters'>
<a href='#' id ="sort">Sort</a>
<a href='#' id='blue'>blue</a>
<a href='#' id='green'>green</a>
<a href='#' id='yellow'>yellow</a>
</div
<div id="box">
<ul id="filter">
<li class="green"></li>
<li class="blue"></li>
<li class="yellow"></li>
<li class="blue"></li>
<li class="yellow"></li>
</ul>
</div>
$('#filters a').click(function(e){
e.preventDefault();
var filter = $(this).attr('id');
$('#box ul li').show();
$('#box ul li:not(.' + filter + ')').hide();
});