ASP.NET ComboBox - Client-Side API - Add/Delete Items

 
Add Item

Remove Item


The ComboBox control provides client-side methods for adding / removing items.

  • Use the add method of the options collection to add items to the list.

    Usage: ComboBox1.options.add(text [, value] [, index]);
    - text - the text of the new item;
    - value - the value of the new item (same as text if not specified);
    - index - the position in the list where the new item should be added
          (if not specified, the item will be added at the end of the list);

  • Use the remove method of the options collection to remove items to the list.

    Usage: ComboBox1.options.remove(index);
    - index - the index of the item to be removed;



« Back to examples