I have a footer section on my website where I want to include a back to top link. The problem is that he cannot determine which page of the site the user is, so he sends it to the html top index. Is there any way to achieve this?
I canβt use <a href="#">Back to top</a> since I have a basic href that links to the websiteβs index page.
This code worked well, cross browser too:
<a href="javascript:void(0)" onclick="parent.window.scrollTo(0,0);">TOP</a>
source share