Browse - programming tips - javascript remove all options in a selectDate: 2008may8 Language: javaScript Q. How do I remove all the options from an HTML <select> ? A. Here is a function that does it. Pass in the object handle of the <select> (not the options). function removeOptions(obj) { obj.options.length = 0; } function removeOptionsAlternate(obj) { while (obj.options.length > 0) { obj.remove(0); } } // Example use: function example() { removeOptions(document.getElementById('myselect')); } Add a commentSign in to add a comment |