JSFiddle - React, Tailwind, and code Playground

HTML

<a id="elem1" href="http://www.google.com">Google</a>
<hr />
<a id="elem2" href="http://www.google.com">Google</a>

JavaScript

document.getElementById('elem1').onclick = function(){
    return false;
};
document.getElementById('elem2').addEventListener(
    'click',
    function(e){
        return false;
    },
    false
);