title: Sort HTML table in ascending and descending order on select box change
body: <p>I want to sort the data in my table in ascending and descending order on select box change. If user selects Ascending from select box option then the data should be sorted in ascending order and same goes for the descending order. I know this is pretty simple but I am a total newbie so please help me do this.  This is what I have done so far.</p>
  
  <p><a href="http://jsfiddle.net/andyshady/Lm7ra/2/" rel="nofollow">FIDDLE</a></p>
  
  <pre><code>function createClickHandler(column, isAscending){
      return function(e){
        table.find('td')
          .filter(function(){
            return $(this).index() === column;
          })
          .sort(function(a, b){
            var order = $.text([a]) &gt; $.text([b]);
            return isAscending ? order : !order;
          }, function(){
            // parentNode is the element we want to move
            return this.parentNode; 
          })
        ;
      };
    }
  </code></pre>
  
  <p>Thanks in advance</p>