JSFiddle - React, Tailwind, and code Playground

HTML

<a onclick='stopIt(event);'>do it</a>

JavaScript

function disableEventPropagation(event)
{
   if (event.stopPropagation){
       event.stopPropagation();
   }
   else if(window.event){
      window.event.cancelBubble=true;
   }
}

function stopIt(event) {
    disableEventPropagation(event);
    alert('dont do it');
}
/*
$(function() {
   
    $('a').click(function(e){
        alert('im doing it');
    });                   
    
});
/**/