Try this..
function removeByElement(arrayName, arrayElement) { //Remove Selected items
for (var i = 0; i < arrayName.length; i++) {
if (arrayName[i] == arrayElement)
arrayName.splice(i, 1);
}
}
function removeAllOptions(selectbox) { //Remove All items
var i;
for (i = selectbox.options.length - 1; i >= 0; i--) {
selectbox.remove(i);
}
}
No comments:
Post a Comment