Remove the selected option from the drop-down list:
The remove() method is used to remove an option from a drop-down list.
Tip: To add an option to a drop-down list, use the add() method.
The remove() method is supported in all major browsers.
Parameter | Description |
---|---|
index | Required. Specifies the index of the option to remove. Index starts at 0 |
Return Value: | No return value |
---|
Remove the option with index "2" from a drop-down list:
Remove the last option from a drop-down list: