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
How to make a functional search engine with javascript inside an own html page?

I have a page with several sections on different pages as word concepts, and I want to implement a search engine so that the user searches for the word, when clicking it redirects it to another page with the results and another option that redirects it to a page with the word what are you looking for

This is my code

HTML

<input class="form-control me-2" type="search" placeholder="Write..." id="text" aria- 
label="Search" required>
<button class="btn btn-outline-success" onclick="Search();">Search  <i class="fas fa-search"> 
</i></button>

Javascript

function Search(text){
var text = document.getElementById("text").value;
if (texto == "a"){
    window.location.assign("results.html");
}else if (text == "azure"){
    window.location.assign("azure.html");
}else
no results
}
}

I am not sure if the search engine is dynamic as I am proposing with this code, I have consulted other sites and they have told me that it is not recommended this way with this code, so if there is a possibility with another code or if there is any error with this, please help me ...

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!