Reputation: 85
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.
Upvotes: 0
Views: 47
Reputation: 1990
I believe if the id does not exist, the browser will handle it the same as '#'. Which links to the start of the page.
Upvotes: 1
Reputation: 943207
Unrecognised fragment identifiers are treated as being at the top of the document.
Upvotes: 1