What does "javascript:void(0)" mean?

Created by rahulLinked to 82.3m issues across 85 teams


The void operator is a JS operator that evaluates an expression and then returns the undefined primitive value. This operator is often used to obtain the undefined primitive value, usually by using the expression void(0).

The void operator can be used in the href of a link to prevent the browser from redirecting to a plain text version of the result of evaluating the JavaScript. If the result of the JavaScript is undefined, then the browser will stay on the same page. void(0) is a short script that evaluates to undefined.