November 19, 2009

Remove all select options with JavaScript

Category: JavaScript, Tags: , khadlock at 1:23 pm

Here's a quick function to remove all select options using JavaScript.

function RemoveAllOptions(selector)
{
     while(selector.hasChildNodes()) selector.removeChild(selector.childNodes[0]);
}
Bookmark and Share

One Response to “Remove all select options with JavaScript”

  1. Social comments and analytics for this post…

    This post was mentioned on Twitter by studiosedition: Remove all select options with JavaScript http://tinyurl.com/ygedslf

Leave a Reply