<select id="foo" multiple>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#">4</a>
<a href="#">5</a>
<select id="SELECT" multiple="">
<option value="1" >qwe</option>
<option value="2">qweewqe</option>
<option value="3" >rqwrqwr</option>
<option value="4" >rqwrqwr</option>
<option value="5" >rqwrqwr</option>
</select>
<a class='click' href="#">1</a>
<a class='click' href="#">2</a>
<a class='click' href="#">3</a>
<a class='click' href="#">4</a>
<a class='click' href="#">5</a>
<script>
$(document).ready(function(){
$('.click').on('click', function(){
var values = $('#SELECT').val();
var current = $(this).text();
if($(this).hasClass('selected'))
{
//тут удалите
$(this).removeClass('selected');
}
else
{
values.push(current);
$(this).addClass('selected');
}
$('#SELECT').val(values).trigger("change");
return false;
});
});
</script>