Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

146
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda