How to make the value passed from other pages equal to a certain one in JS, then the selected one will be selected by default?
var ops = drop-down menu.childNodes;
for(var i=0;i{
if(pass it over The value == ops[i].innerText) //It can also be ops[i].value, depending on the situation
{
ops[i].selected = "selected";
}
}
A simple judgment will suffice, I don’t know where the poster is in trouble
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn