Home > Web Front-end > JS Tutorial > js value transfer judgment_form effects

js value transfer judgment_form effects

WBOY
Release: 2016-05-16 19:24:42
Original
1127 people have browsed it

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?

Copy code The code is as follows:

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template