An interesting alternative to a link with a hash (alternative zu link mit hash) such as
In this case, whether the link is clicked or the onclick function errors or returns a non false value doesn’t matter, the browser stays on the page and the URL doesn’t needlessly changed.
Example 2 – hash link: Note the current URI, now try this link. The URI has changed to have “#thisGoesNowhere” appended to the end, right ? Not very nice, and if your URI is shared or bookmarked, this may have unintended consequences.
Arguably we should (?) be using the button or some other tag in this case, but if we want to stick with the anchor tag (as I do) then this approach can work well.