Javascript void is an operator for return a
Here is a typical hyperlink:
<a href="http://www.endmemo.com">Home</a>
Home, If you click the link, the home page will be loaded.
We can use a hyperlink execute javascript, rather than loading a new web page:
<a href="javascript: alert('JS');">JS Link</a>
JS Link
Use
<a href="javascript:void(x=5);alert(x);">JS Link</a>
Link
<a href="javascript:void(0)" ondblclick="alert('dblclick')">Link</a>
Link
Without
<a href="" ondblclick="alert('dblclick')">Link</a>
Link