Answers for "How to remove options from selectlist in javascript?"

0

How to remove options from selectlist in javascript?

var selectobject = document.getElementById("mySelect");
for (var i=0; i<selectobject.length; i++) {
    if (selectobject.options[i].value == 'A')
        selectobject.remove(i);
}
Posted by: Guest on May-03-2020
0

How to remove options from selectlist in javascript?

<select id="mySelect" name="val" size="1" >
    <option value="A">Apple</option>
    <option value="C">Cars</option>
    <option value="H">Honda</option>
    <option value="F">Fiat</option>
    <option value="I">Indigo</option>                    
</select>
Posted by: Guest on May-03-2020

Code answers related to "How to remove options from selectlist in javascript?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language