<select id="example" name="example" multiple="multiple"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> <option value="5">Option 5</option> </select>
<span class="click" id="1">one </span>
<span class="click" id="2">two </span>
<span class="click" id="3">three </span>
<span class="click" id="4">four </span>
$('.click').click( function() {
$(this).css('background-color', 'red');
$('#example').val($(this).attr('id'));
});
how can i make that use multiple select and if i click again span with background-color=red then css background-color is again white?
LIVE EXAMPLE: