- Q) 특정한 id값을 가지는 엘리먼트로 스크롤를 이동하려면 어떻게 해야 할까?
- A)
element.scrollIntoView
를 사용하면 된다.
const el = document.getElementById("item")
el.scrollIntoView({ behavior: "smooth" })
element.scrollIntoView
를 사용하면 된다.const el = document.getElementById("item")
el.scrollIntoView({ behavior: "smooth" })