Hi,
this template Scroll to top button can be improoved by changing
<a class="am-button">
to
<a class="am-button_toTop">
and
const button= document.querySelector('.am-button')
to
const button= document.querySelector('.am-button_toTop')
Otherwise the first Element with a class of “am-button” will receive this function to scroll to the top . This can be undesired. The Template should make sure the only Element to scroll to the top is the one within this Mod
The JS will search for am-button all across the entire webpage