To prevent a click on a ‘#’ link from jumping to top of page with JavaScript, we set the href attribute to some JavaScript code.
For instance, we write
<a href="javascript:void(0);">link</a>
to set the href attribute to javascript:void(0);
to stop the link from jumping when we click it.
void(0)
does nothing so nothing will happen when we click the link.