Here is a simplified version of the problem.
Clicking on the button
I need to call function abc
and stop to execution both functions abc and click
if x == 5
;
Current situation - abc
is canceled, but click
continues to execute.
function abc(){
if(x == 5){return;}
console.log('abc');
}
var x = 5;
$('button').on('click', function(){
abc();
console.log('clicked');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button>CLICK</button>