When you click on the link with the
#1234 and presumably the page refreshes, does the
#1234 still show in the navigation bar of your browser? Just wondering if something in your application is doing a redirect and losing it along the way?
Also, hopefully a silly question, but... 🤷 Is there enough content after the element you're pointing at that it can actually be scrolled to the top of the window? (The browser won't just add space after the end of the document.)
Final thought: I believe
id= is preferred over
name=, though either should work (but if you use both, they must have the same value.) However, make sure only one element has that ID, otherwise the results are unpredictable at best.