JQuery: Show Distinct items of DropdownList

May 09, 2016 0 Comments

In this article i will show you, how to remove duplicates in DropdownList when it appear on browser window. If you have multiple item in the table and you want to show only distinct items of the table then you can use siblings function of the JQuery. Lets check the simple example:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="Scripts/jquery-1.10.2.js"></script>
        $(function () {
            $("select option").each(function () {
                $(this).siblings("[value=" + this.value + "]").remove();
    <form id="form1" runat="server">
        <h2>How to Remove duplicate dropdown option elements with same value</h2>
    <div><select name="selectlist">
    <option value="">Fruit List</option>
<option value="1">Apple</option>
<option value="2">Mango</option>
<option value="1">Grapes</option>
<option value="2">Orange</option></select>
Code Generate the following output:

 JQuery: Show Distinct items of DropdownList

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google