JSFiddle - React, Tailwind, and code Playground

HTML

<a id="link" href="http://www.google.com">link</a>
<button id="button" onclick="alert('an alert')">button</button>

JavaScript

$('#link').click(function(event){
    event.preventDefault();
});
$('#button').click(function(event){
    event.preventDefault();
});