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

150
Views
Hide HTML attribute value from users within input field - instantsearch custom search

I have a small issue with InstantSearch JS as I have custom code and decided to change the regular search widget to a Custom Search widget based on Algolia documentation.

I need to implement custom code that wasn't possible with a regular search widget - I couldn't access search functions to add the code I need.

The problem is that I'm also using custom code where add hidden attribute data-search-term which helps display initial results based on this term. But with the default search widget value of this term been all the time hidden, not visible within the input field but when I switched to the custom search widget value of this attribute is visible and each time when I type into input fields, it duplicates its content.

Des someone have the solution to this problem? How can I hide the value of this attribute from the input field so it will stay within DOM but will be hidden from the input for users?

<div id="searchbox" data-feed="widget" data-category="Test" data-search-term="Demo"></div>

Above is HTML, it has data-search-term. It passes this one into the input field that is generated by InstantSearch JS.

As a result of that data-search-term is visible within input. How can I hide it?

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!