ड्रॉपडाउन लिस्ट से विकल्प हटाने के लिए, JavaScript में remove() मेथड उपयोग करें। ड्रॉप-डाउन से विकल्प हटाने का तरीका जानने के लिए निम्न कोड चलाएं:
उदाहरण
<!DOCTYPE html> <html> <body> <form id = "myForm"> <select id = "selectNow"> <option>One</option> <option>Two</option> <option>Three</option> </select> <input type = "button" onclick = "remove()" value = "Click to Remove"> </form> <p>Select and click the button to remove the selected option.</p> <script> function remove() { var x = document.getElementById("selectNow"); x.remove(x.selectedIndex); } </script> </body> </html>