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

185
Views
Uncaught TypeError: Cannot read property 'scrollIntoView' of undefined

Uncaught TypeError: Cannot read property 'scrollIntoView' of undefined want to create dynamic navbar and scrollintoView to sections in javascript?

var sections = document.querySelectorAll("section");
for(link=0; link<sections.length+1; link++){
    var li= document.createElement('li');
    var texet_linke =sections[link].getAttribute("data-nav");
    li.innerHTML =texet_linke;
    
    var ul= document.getElementById('navbar__list');
    ul.appendChild(li);
    li.addEventListener("click", myFunction);
    
    function myFunction() {
        sections[link].scrollIntoView();
    }
}
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!