JavaScript
Article
By Sam Deering

What is javascript:void(0);

By Sam Deering
Last chance to win! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

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.

--ADVERTISEMENT--

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

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?