Remove an option from a select box

August 30, 2014 | Last tested: October 2015 | 508 views | Comments

Manipulate select options from a select box using jQuery. A specific option can be removed by using the remove() function.

For example.

Remove all options except the first one.

$("#ELEM option").not(":eq(0)").remove();

 

Live Demo:

Click here to remove all options except the first one.

 

Remove the second option from the selection.

Note: The count starts at zero. Therefore second option is at position # 1.

$("#ELEM option").eq(1).remove();

 

Live Demo:

Click here to remove the second option.