Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!