Selecting multiple options and displaying selected

Select Multiple options by pressing Ctrl key
Selected options will be displayed.




<script>
$(document).ready(function() {
$("#student").change(function(){
my_function();
});
////////
var my_function = function() {
var str=new Array();
$("#student option:selected").each(function() {
  str.push($(this).val());
});	
$("#display1").html(str.join(","));
}
////////
$("#b2").click(function(){
$('#student option').prop('selected', true);
my_function();
});
///////
});
</script>