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

104
Views
Expandable search bar with dropdown values

The search bar will expand while the mouse is focused on it. The results will appear when you click in the search bar and the results will appear in drop down. When I select a drop-down value, the search bar returns to its default form, and I am not able to capturing the on-click drop down results and unable to navigate the appropriate page.

Here is the HTML:

`<input type="search" class="form-control search-dropdown" placeholder="Search..." id="top-search" spellcheck="false">`

`<div class="dropdown-menu dropdown-sm" id="search-dropdown" data-toggle="collapse">
<div class="dropdown-header"><a href="javascript:void(0);" class="text-overflow searchItem" data-name="text1">Text1</a></div>
<div class="dropdown-header"><a href="javascript:void(0);" class="text-overflow searchItem" data-name="text2"> Text2</a></div>
<div class="dropdown-header"><a href="javascript:void(0);" class="text-overflow searchItem" data-name="text3"> Text3</a></div>
</div>`

CSS:

`.form-control:focus {
    width:300px;
    position:absolute;
}`

JS:

`$(".searchItem").on("click", function(e)({
    e.stopImmediatePropagation();
    let searchedText = $(this).data('name');
    $("div#pageContent").load('./'+searchedText+'.html');
})`

I am using Bootstrap 5 for this.

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!