title: jQuery sortable move up/down multiple <options> in <select>
body: <p>I am trying to move the  in  using the following code but when i select multiple options it doesn't work right</p>
  
  <p>How can I move multiple elements up and down?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;  
    \$().ready(function() { 
  //for moving elements up and down
  \$('.up-button').click(function(){
  
   before = \$('#select2 option:selected').prev();
      \$('#select2 option:selected').insertBefore(before);
      });
  
  \$('.down-button').click(function(){
     after = \$('#select2 option:selected').next();
      \$('#select2 option:selected').insertAfter(after);
  }); 
     });  
   &lt;/script&gt;
  </code></pre>
  
  <p>You can find the reference at <a href="http://jsbin.com/etOcAHu/3/edit" rel="nofollow">JS live code</a> </p>