Ok I'm new to this please don't judge me I looked around on the net and every video or suggestion seems over complicated as I managed my button to go to the top, I'm just missing the smooth animation. What am I missing form the below code?
const myBtn = document.querySelector("#myBtn");
myBtn.addEventListener("click", function() {
window.scrollTo(0, 0);
});