Save to foursquare
Daniele Cruciani
Programmatore Developer PHP/MySQL Freelance
mobile: +39 3489215204

icq skype msn linkedin fb t ff youtube picasa google me on github

Pubblicità

Tu sei qui

move multiple option in select with jQuery

    I look for this everywhere: how to move multiple option inside a select
    function upfield() {
      var el = $('#selectedfield').children('[@selected]:first').prev();
      $("#selectedfield")
        .children('[@selected]')
        .each(function(){
    	$(this).insertBefore(el);
          });
    
    }
    
    function downfield() {
      var el = $('#selectedfield').children('[@selected]:last').next();
      $("#selectedfield")
        .children('[@selected]')
        .each(function(){
    	$(this).insertAfter(el);
    	el = $(el).next();
          });
    }