HTML a href javascript void 0 can be used when we don’t want to refresh or load a new page in the browser by clicking a hyperlink. The javascript:void(0) tells the browser to “do nothing”.
href="javascript:void(0)"
javascript:void(0)
<!DOCTYPE html>
<html>
<body>
<a href = "javascript:void(0);">It will do nothing.</a>
<br/><br/>
<a href = "javascript:alert('Hello');"> Click alert </a>
</body>
</html>
Output:

You can use the event.preventDefault with the event handler as an alternative to JavaScript:void(0).
<!DOCTYPE html>
<html>
<body>
<a href="https://www.eyehunts.com" onclick="event.preventDefault();" ondblclick="alert('Task completed')">Double Click Me!</a>
</body>
</html>
Do comment if you have any doubts or suggestions on this JS void topic.
Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version