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