Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

120
Vistas
Toggle buttons issue

If I click on search icon it will open back button and search bar. Again I click on the back button it will open search icon

I tried with inner html.

If I click on search icon I used innerhtml to display back button and search bar. But if I click on back button how to render search icon?

container.insertAdjacentHTML('afterbegin', `
  <header>
    <div id="chat-icon">
      <div class="search"><i class="fas fa-search"></i></div>
      <div id="chat"><i class="far fa-edit"></i></div>
    </div>
  </header>
  <div id="group-list"></div>`);

container.querySelector('header #chat-icon #chat').addEventListener('click', async() => {
  this.chat.container.querySelector('.groups').remove();
  this.chat.container.insertAdjacentElement('afterbegin', this.createGroup.container);
  await this.createGroup.load();
});

container.querySelector('header .search').addEventListener('click', async() => {
  this.chat.container.querySelector('header .search').innerHTML = `
    <div class="heading">
      <div id="back-button"><i class="fa fa-arrow-left"></i></div>
      <div id="search-bar"></div>   
    </div>`
})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Instead of .remove() and .load(), you can use .hide to hide the searchbar and .show() to show it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda