<script>
const boton + document.querySelector(“#backtotop”)
windows.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 500 || document.documentElement.scrollTop > 500) {
boton.style.display = “block”;
}
esle {
boton.stule.display = “none”;
)
}
boton.addEventlistener(“click”, () => {
document.documentElement.scrollTo({
top: 0,
behavior: “smooth:,
});
});
</script>