/ Published in: JavaScript
This will remove the items in a select box/list box that have been selected.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function remove_selected_items(listid){ var list = document.getElementById(listid); var items = list.options.length; for(var i = items-1; i >= 0; i--) { if(list.options[i].selected == true){ list.remove(i); } } }