I need a javascript code that will retreive the Y position of a html object (in this case its "downarrow") so I can use it as a variable. Example:
var topscrollvalue = // will be the Y of "downarrow"
function scroll_to(){
window.scrollTo({
top: topscrollvalue, //value that will be scrolled
left: 0,
behavior:"smooth"
}
)
}
basically i need the "topscrollvalue" variable to be the Y value of "downarrow" object in my html document.