on-internet
← Community

Setting href to "javascript:void(0)" vs onclick to "return false"

Stack Overflow ·

After reading both : difference between "void 0 " and "undefined" , https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/void I still have some questions. I've read that window.undefined can be overwritten vwhere void operator will return the undefined value always But the example which caught my eyes was the one in MDN : <a href="javascript:void(0);">Click here to do nothing</a> In order to do nothing , I always thought I should write : href="javascript:return false;" And this leads me to another question : (at Href context !) : javascript:void(0); vs javascript:return fals

Comments

Sign in or sign up to comment and upvote.

No comments yet.