I am think this should be fairly easy, but struggling a bit ... I have a SELECT
input element that allows the user to select multiple items. I would like to pro
This solution worked for me...
$('#my-Select').val('').trigger('change');
This works on almost any input type.
Better than this, you can use:
$("#selectID").empty();
That works on almost anything in the DOM.
Try that:
$("#selectID").empty();
Worked for me!
Only this worked for me:-
$("#selectid").find('option').attr("selected",false) ;
This worked to clear all selected options for me..
$("#selectListName").prop('selectedIndex', -1)
The select list looked like
<select multiple='multiple' id='selectListName'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
Try: // Just put # before select to fix this. Works perfect. $("#select option:selected").each(function () { $(this).remove(); //or whatever else });