Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!