JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<a class='button noreturn' href="#" onclick="return false;">Click Me (with return false)</a><br>
<a class='button noreturn' href="#" >Click Me (without return false)</a><br>
<a class='button returnfalse' href="#" >Click Me (jQuery return false)</a><br>
</div>
CSS
.container {
border: 1px solid red;
padding: 20px;
}
a {
margin: 10px;
display: inline-block;
}
.button {
height: 20px;
padding: 4px;
background-color: blue;
color: white;
border: 1px solid black;
}
JavaScript
$('a.noreturn').on('click',function(e) {
console.log('clicked button');
});
$('a.returnfalse').on('click',function(e) {
console.log('clicked button');
return false;
});
$('div').on('click', function() {
console.log('clicked div');
});