[Solved] Jquery Multiple Select Show values in [closed]


Try it like,

var ul = $('<ul>').appendTo('body');

function createList() {
  ul.empty();
  $('select option:selected').each(function() {
    li = $('<li/>').text($(this).text()).attr('value', this.value);
    li.appendTo(ul);
  });
}

$('select').on('change', function() {
  createList()
}).trigger('change');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<select name="is_format" id="is_format">
   <option value="A4">{l s="A4"}</option>
   <option value="A3">{l s="A3"}</option>
</select>

<select name="is_color" id="is_color">
   <option value="Couleur" selected>{l s="Couleur"}</option>
   <option value="Noir/Blanc">{l s="Noir et Blanc"}</option>
</select>

3

solved Jquery Multiple Select Show values in

  • [closed]