What is javascript:void(0);? This operator allows inserting expressions that produce side effects into places where an expression that evaluates to undefined is desired.

The void operator evaluates the given expression and then returns undefined.

Example Usage

Click here to do nothing
Click here for green background

See this post for further info: Different ways to run a JavaScript function

Further Reading

Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.


No Reader comments

Learn JavaScript for free!
Free course: Introduction to JavaScript

Yours when you take up a free 14-day SitePoint Premium trial.