This post will discuss how to remove all options from a dropdown list in JavaScript and jQuery.

1. Using jQuery

jQuery has .remove() method for removing elements from the DOM. We can use it to remove all <option> from a <select> element, as shown below:

JS


HTML



Edit in JSFiddle

 
Like the .remove() method, we can use the .empty() method to take the elements out of the DOM.

JS


HTML



Edit in JSFiddle

 
Alternatively, you can use the .html() method to set the select element content empty.

JS


HTML



Edit in JSFiddle

2. Using JavaScript

In plain JavaScript, you can get the list of all options using the querySelectorAll() method and then call JavaScript’s remove() method on each one of them.

JS


HTML



Edit in JSFiddle

 
Another simple and fairly efficient solution is to use the browser’s innerHTML property, which is also being used by the jQuery’s .html() method.

JS



Edit in JSFiddle

That’s all about removing all options from a drop-down in JavaScript and jQuery.