Reputation: 575
I have multiselect list box, I want to clear all selected items On clear button click.
<asp:ListBox id="StatusField" runat="server" SelectionMode="Multiple" Rows="4" />
I tried as follows.
$("#StatusField option:selected").removeAttr("selected");
Upvotes: 0
Views: 6454
Reputation: 575
I solved the problem.
$("#[id$=StatusField ]").multiselect("uncheckAll");
Upvotes: 3
Reputation: 10649
Seeing as how your code is for a dropdown and not a select box, you can try:
$('#StatusField :selected').attr('selected', '');
Upvotes: 0