function selectBoxRemove(sourceID) { //get the listbox object from id. var src = document.getElementById(sourceID); //iterate through each option of the listbox for(var count= src.options.length-1; count >= 0; count--) { //if the option is selected, delete the option http://www.sharejs.com if(src.options[count].selected == true) { try { src.remove(count, null); } catch(error) { src.remove(count); } } } } //javascript/8785