diff --git a/snippets/smoothScroll.md b/snippets/smoothScroll.md index 0e3d3aa94..9165715d2 100644 --- a/snippets/smoothScroll.md +++ b/snippets/smoothScroll.md @@ -5,7 +5,7 @@ Smoothly scrolls the element on which it's called into the visible area of the b Use `.scrollIntoView` method to scroll the element. Pass `{ behavior: 'smooth' }` to `.scrollIntoView` so it scrolls smoothly. ```js -const smoothScroll = (element) => +const smoothScroll = element => document.querySelector(element).scrollIntoView({ behavior: 'smooth' });