I\'m using a select tag in a form I\'m making that allows multiple selections, but I want to make the maximum amount of selections upto 10. Is this possible using javascript
This would limit the user to 3 options:
$("select").on("click", "option", function () { if ( 3 <= $(this).siblings(":selected").length ) { $(this).removeAttr("selected"); } });
Fiddle: http://jsfiddle.net/2GrYk/