@JaySODec 06.2022 — #In HTML, it is generally better to use the javascript:void(0) syntax for links that have an onclick event, rather than using the # symbol. This is because using javascript:void(0) as the href for the link will prevent the default behavior of the link, which is to navigate to a new page or to an anchor on the current page.
If you use the # symbol as the href for a link that has an onclick event, the default behavior of the link will still occur, even if you cancel the event in the onclick handler. This can cause the page to navigate away from the current page, or to jump to an anchor, before your onclick code has a chance to run.
Here's an example of how you might use the javascript:void(0) syntax for a link that has an onclick event:
The onclick event will be triggered when the user clicks on the link. The javascript:void(0) syntax ensures that the default behavior of the link (which is to navigate to a new page) will not occur.