I think the answer may be easier to understand like this:
$('#empid').on('change',function() {
alert($(this).val());
console.log($(this).val());
});
Hold CTRL / CMD for selecting multiple fields
If you select "Carrot" and "Raisins" in the list, the output will be "1,3".