Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda