document.querySelector(".header__arrow").addEventListener('click', arrowScroll); function arrowScroll(){ document.querySelector(".header").scrollIntoView({ behavior: 'smooth' }); }