I have a button <a href="#top">Top</a>
linking to the top of the page <body id="top"></body>
but when removing the id of the body the button still works. I cant work this out, I put it down to the browser cacheing data although I have emptied the cache and re-tried and it still works. This is purely informative, its not causing me any issues.
why does the top button still link to the top of the page?
54 Views Asked by Sam Marchant At
2
I believe if the id does not exist, the browser will handle it the same as '#'. Which links to the start of the page.