# Remove DropDownList Items

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Progress® Kendo UI® DropDownList for jQuery</td>
 </tr>
 <tr>
  <td>Operating System</td>
  <td>Windows 10 64bit</td>
 </tr>
 <tr>
  <td>Visual Studio Version</td>
  <td>Visual Studio 2017</td>
 </tr>
 <tr>
  <td>Preferred Language</td>
  <td>JavaScript</td>
 </tr>
</table>

## Description

How can I remove items from a Kendo UI DropDownList?

## Solution

The following example demonstrates how to achieve the desired scenario.

```dojo
    <input id="color" />
    <button class="k-button" id="remove">Remove items</button>  
     
    <script>
      $(document).ready(function() {
        var data = [
          { text: "Black", value: "1" },
          { text: "Orange", value: "2" },
          { text: "Grey", value: "3" }
        ];

        // create DropDownList from input HTML element
        $("#color").kendoDropDownList({
          dataTextField: "text",
          dataValueField: "value",
          dataSource: data
        });

        $("#remove").click(function() {
          var ddl =  $("#color").data("kendoDropDownList");

          var oldData = ddl.dataSource.data();

          ddl.dataSource.remove(oldData[0]); //remove first item
          ddl.dataSource.remove(oldData[oldData.length - 1]); //remove last item
        });
      });
    </script> 
```

## See Also

* [JavaScript API Reference of the DropDownList](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/dropdownlist)
* [Automatically Adjust the Width of a DropDownList](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/auto-adjust-the-width)
* [Create DropDownLists with Long Items](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/create-dropdownlist-with-long-items)
* [Detect Wrapper Focus Events](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/detect-wrapper-focus-event)
* [Move the Group Label on Top of Items](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/group-label-on-top-of-the-items)
* [Prevent Popup Closure on Scroll](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/prevent-close-on-scroll)
* [Set DataSource Dynamically](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/set-datasource-dynamically)
* [Update MVVM Bound Models on Load](https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/update-model-on-load)
