May 06, 2021 JavaScript
We often use code like javascript:void(0), so what does javascript:void(0) mean in JavaScript?
The most critical thing about 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.
The following code creates a hyperlink that doesn't happen when the user clicks.
Void(0) is calculated as 0 when the user links, but has no effect on Javascript.
In the following example, a warning message is displayed after the user clicks on the link:
Parameter a in the following example returns undefined:
# Contains a location information, the default anchor is the #top the upper end of the page.
Javascript:void(0), on the other, represents only a dead link.
At a very long time, the page # in the format of: .
If you want to define a dead link, use javascript:void(0).
Note: void() simply represents that no value is returned, but the expression in parentheses is still to be run
Javascript Encyclodedi: javascript:; Use the introduction with javascript:void(0).