JSFiddle - React, Tailwind, and code Playground

HTML

<div id="machin">tire mon doigt</div>

JavaScript

$('#machin').on('click', function(){
    var a = document.createElement('a');
    a.setAttribute("href", "http://www.google.fr");
    a.setAttribute("target", "_blank");
    var event = new MouseEvent('click', {
        'view': window,
        'bubbles': true,
        'cancelable': true
    });
    a.dispatchEvent(event);
});

$(document).on('click','a',function(e) {
    alert("prout");
});