Setting href to "javascript:void(0)" vs onclick to "return false"
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
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.