In this post, we will see how to remove selected item from DropDownList using jQuery when button will be clicked.
Let’s say we have DropDownList like this:
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="0">SELECT</asp:ListItem>
<asp:ListItem Value="1">APPLE</asp:ListItem>
<asp:ListItem Value="2">BANANA</asp:ListItem>
<asp:ListItem Value="3">ORANGE</asp:ListItem>
<asp:ListItem Value="4">MANGO</asp:ListItem>
</asp:DropDownList>
We will use html button to remove item from DropDownList
<input id="btnClick" type="button" value=" Click " />
Here’s an example
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#btnClick").click(function () {
$("#<%=DropDownList1.ClientID %> option:selected").remove();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="0">SELECT</asp:ListItem>
<asp:ListItem Value="1">APPLE</asp:ListItem>
<asp:ListItem Value="2">BANANA</asp:ListItem>
<asp:ListItem Value="3">ORANGE</asp:ListItem>
<asp:ListItem Value="4">MANGO</asp:ListItem>
</asp:DropDownList>
<br />
<input id="btnClick" type="button" value=" Click " />
<asp:Label ID="Label1" runat="server"></asp:Label>
</div>
</form>
</body>
</html>
Output

Download
Remove-Item-from-DropDownList.rar (671.00 bytes)
See live demo