The void operator usage format is as follows:
1. javascript:void (expression)
2. javascript:void expression
expression is a JavaScript standard expression to be calculated. The parentheses outside the expression are optional, but it is a good practice to write them. We can specify hyperlinks using void operator. The expression is evaluated but nothing is loaded into the current document. The code above creates a hyperlink that does nothing when the user clicks on it. When the user clicks the link, void(0) evaluates to 0, but has no effect on JavaScript.
Nothing will happen if you click here
That is to say, if you want to perform some processing without refreshing the page as a whole, you can use void(0), but when needed When refreshing the page, be careful.
When calling this custom JS function, if we use click, although the method can be executed, if the page contains a scroll bar, it will automatically scroll to the top of the page. If At this time, we use click. When executed, the page will not scroll. This should be very useful for image switching and AJAX calls.