Cancel the default even behaviour of the browser: preventDefault, return false;
First off, return false is actually doing three very separate things when you call it: event.preventDefault(); event.stopPropagation(); Stops callback execution and returns immediately when called. See jquery-events-stop-misusing-return-false for more information. For example: 1. In the case of clicking on links, return false will prevent navigation, the href attribute specifies the link's destination will be ignored. <a href = '#' onclick = ' Func ( ); return false ; ' > Click </a> <a href="http://www.w3schools.com/" onclick="alert( ); event.preventDefault() ;">w3schools</a> <a href="http://www.w3schools.com/" onclick=" return (confirm('Follow this link?'))">w3schools</a> 2. In form submit handlers <button type="submit" onclick="return confirm('Do you want to submit?');">Submit</button> preventDefault If an eve...