Answer the question
In order to leave comments, you need to log in
Navigate to anchor without clicking and changing url?
Hello, how can I implement this without updating the url?
Answer the question
In order to leave comments, you need to log in
Scroll to the desired element on the page
const el = document.querySelector('#el'); // элемент до которого нужно скролить страницу
el.scrollIntoView({
block: 'start', // если start то страница будет прокручена к началу элемента
behavior: 'smooth' // отвечает за плавную прокрутку
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question