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

126
Vistas
Multiple Tab Handling with JS (DOM)
<ul class="search-tabs">
<li class="rent active">Rent</li>
<li class="buy">Buy</li>
<li class="sell">Sell</li>
</ul>

<form id='rent' class='visible'>
<form id='buy'>
<form id='sell'>

This is my code and I wan't to create a feature that does the following:

  • adds 'active' into the li's classList, when I click it.
  • but only when the form has className = 'visible' and that form's id = the clicked li's classList. Else, it removes the 'active' from the li's classList.

It adds the 'active' class, but doesn't remove the 'active' class from the other li's that have not been clicked. Any solution? Please help!

about 4 years ago · Juan Pablo Isaza
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