void 0 js
javascript void(0)
<!DOCTYPE html>
<html>
<head>
<title>Understanding JavaScript void(0)</title>
</head>
<body>
<a href="javascript:void(0);" ondblclick="alert('Click it twice!')">Click me not once, but twice.</a>
</body>
</html>
Source: www.tutorialspoint.com
where use javascript:void(0)
<a href="javascript:void(0)">Link</a>
Source:www.freecodecamp.org
javascript.void(0)
The void operator evaluates the given expression and then returns undefined.
The void operator is often used merely to obtain the undefined primitive value, usually using “void(0)” (which is equivalent to “void 0”). In these cases, the global variable undefined can be used instead (assuming it has not been assigned to a non-default value).
An explanation is provided here: void operator.
The reason you’d want to do this with the href of a link is that normally, a javascript: URL will redirect the browser to a plain text version of the
Có thể bạn đã miss một số snippets code