I have this problem, I want to conditionally stop the anchor from jump.
condition jump
I tried to add some codes in my coditionFun function to conditionally stop it from jumping.
function conditionFun() { 
    var flag=false; 
    if(flag){ 
        console.log('you allowed anchor jump'); return true;
    } else {
        console.log('you stopped the anchor jump');return false;
    }
}
I was hoping to get "you stopped the anchor jump" and DO NOT jump to "http://www.google.com.hk", but it logged "you stopped the anchor jump" and immediately jump to "http://www.google.com.hk", anyone help me with this? thank you!