This article introduces in detail three different ways to clear the options in the select tag. The specific syntax format is as follows. Interested friends can refer to it. I hope it will be helpful to everyone
Method 1
Copy code
The code is as follows:
document.getElementById("selectid").options.length = 0;
Method 2
Copy code
The code is as follows:
document.formName.selectName.options.length = 0;
Method 3
Copy code
The code is as follows:
document.getElementById("selectid").innerHTML = "";