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

185
Visualizações
Why isn't forEach working after page refresh?

I want to add and remove 'selected-bullet' class but first time it is working and after refresh browser it is not working. why is not forEach working after page refresh?

const Resume = () => {
const bullets = document.querySelector('.bullets');
const bullet = document.querySelectorAll('.bullet');
  [...bullet].forEach((el) => {
    el.addEventListener('click', () => {
      bullets
        .querySelector('.selected-bullet')
        .classList.remove('selected-bullet');

      el.classList.add('selected-bullet');
    });
  });
  return (
    <div className='resume-bullets'>
      <div className='bullet-container'>
        <div className='bullet-icons'></div>
        <div className='bullets'>
          <div className='bullet selected-bullet'>
            <i className='bi bi-mortarboard-fill bullet-logo'></i>
            <span className='bullet-label'>Education</span>
          </div>
          <div className='bullet'>
            <i className='bi bi-clock-history bullet-logo'></i>
            <span className='bullet-label'>Work History</span>
          </div>
          <div className='bullet'>
            <i className='bi bi-laptop bullet-logo'></i>
            <span className='bullet-label'>Programming Skills</span>
          </div>
          <div className='bullet'>
            <i className='bi bi-bar-chart-line bullet-logo'></i>
            <span className='bullet-label'>Projects</span>
          </div>
          <div className='bullet'>
            <i className='bi bi-palette bullet-logo'></i>
            <span className='bullet-label'>Interests</span>
          </div>
        </div>
      </div>
    </div>
  );
};
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