ioSamurai ioSamurai - 1 year ago 64
jQuery Question

Quick way to clear all selections on a multiselect enabled <select> with jQuery?

Do I have to iterate through ALL the and set remove the 'selected' attribute or is there a better way?

Answer Source

Simply find all the selected <option> tags within your <select> and remove the selected attribute:

$("#my_select option:selected").removeAttr("selected");