I want user to select maximum of only three options from multiple select options. I tried this code so far:
Try this Fiddle.
$("select option").click(function() { if ($("select option:selected").length > 3) { $(this).removeAttr("selected"); alert('You can select upto 3 options only'); } });