javascript:void (0) meaning
The key in Javascript:void (0) is the Void keyword, which is a very important keyword in JavaScript, which specifies that an expression is evaluated but does not return a value.
<a href= "javascript:void (0)" > Click here Nothing will happen </a>
In the following example, the user clicks the link and displays a warning message, but does not renege on any value:
<a href= "javascript:void (alert (' Warning!!! '))" > I!</a>.
In the following instance, because void specifies to evaluate an expression but does not return a value, parameter a returns undefined:
function getValue () { var A, B, C; void (b = 5, c = 7 ); document.write (' a = ' + A + ' B = ' + b + ' c = ' + c);} </script>
The difference between href= "#" and href= "javascript:void (0)"# contains a location information, the default anchor is #top that is the top of the page.
and javascript:void (0), only represents a dead link.
When the page is long, it uses # to locate the page in the format:# + ID.
If you want to define a dead link please use Javascript:void (0).
<a href= "javascript:void (0);" > Point I'm not responding.!</a> <a href= "#pos" > point I position to the specified location!</a> <br> <br> <p id= "pos" > Trailing anchor points </p>
Javascript:void (0) meaning