How can I select all options of multi-select select box on click?

The Solution to How can I select all options of multi-select select box on click? is


Try this:

$('#select_all').click(function() {
    $('#countries option').prop('selected', true);
});

And here's a live demo.

~ Answered on 2012-03-29 11:45:23


Most Viewed Questions: