I would like to know what is the difference between javascript:;
and javascript:void(0);
if I use them in href
attribure for a
anchor (link)
<a href="javascript:;" onclick="DoSomething();">Link</a>
<a href="javascript:void(0);" onclick="DoSomething();">Link</a>
I see them acting the same on all browsers but what is the technical difference?
Regards, Magdy
One runs JavaScript that has no statements, the other runs JavaScript that evaluates the statement 0
and then returns undefined
.