97/121

Scroll to an element

Scroll to the ele element

ele.scrollIntoView();

Smoothly scroll

The behavior option isn't supported in IE and Safari.

ele.scrollIntoView({ behavior: 'smooth' });

Good to know

The similar CSS property which provides the same functionality is

scroll-behavior: smooth;

It isn't supported in IE and Safari.

Might be useful