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

385
Visualizações
How to hide MULTIPLE sections and show only one section in Elementor with a button (NOT Accordion)?

I have multiple sections in Elementor with IDs #section1, #section2, #section3 and so on... I created buttons and each button functionality should be to show only one section and hide ALL others. I can do that only for 1 section and 1 button with JS, but it seems I am not successful with multiple sections. I need to do that without refreshing the page. Any ideas?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Am not sure if this is what you want but seems to work for me

enter code here

`enter code here`</div>
`enter code here`<div id="section2">

`enter code here`</div>

`enter code here`<button class="section1">button1</button>
`enter code here`<button class="secss">button2</button>

use your own styling

the javascript enter code here"use strict";

enter code hereconst btn1 = document.querySelector(".section1"); enter code hereconst btn2 = document.querySelector(".secss");

enter code hereconst section1 = document.getElementById("section1"); enter code hereconst section2 = document.getElementById("section2");

enter code herebtn1.addEventListener("click", function() { enter code heresection1.classList.add("hidden"); enter code here});

enter code herebtn2.addEventListener("click", function() { enter code heresection1.classList.remove("hidden"); enter code heresection2.classList.add("hidden"); enter code here});

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