Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
Iterate through a <select> element?

I want to make a form in HTML & JS in client-side. I know how to make a search form that iterates through an array or a object, and the webpage displays A when your search value is B. But how can I add the select element in my function to make my search form more complex? Image I want the ability to either search for four-wheelers or two-wheelers, and the select field should make it possible to only have one criteria at the time.

Heres a brief explanation of a code resembling what I already know, without using the select element as I have no idea on how to

<html>
<form>
<input id="write" type="text">
<select> <option> Four-wheeler </option> <option> Two-wheeler </option> </select>
<input type="submit" id="btn">
</form>
</html>
<script>

var info = [        
     new Bil("Ford", 1999, "black"),
     new Bil("BMW", 1992, "red"), 
];

function search() {
    var z = String(field.value);
    for(var i = 0; i<info.length; i++) {
        if(z === info[i].make) {
            para.textContent = info[i].year 
        }
    }
}
</script>


about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda