Published in: JavaScript
var optValue = 3; // value of the item to delete var myOptionList = document.getElementById("myList"); var theposition= ''; for(var i=0;i<myOptionList.length;i++) { if(myOptionList.options[i].value == optValue); { theposition = myOptionList.options[i].index; } } myOptionList.remove(theposition);
You need to login to post a comment.
