JSFiddle - React, Tailwind, and code Playground

HTML

<a href="javascript:void(0)">CLICK</a>

JavaScript

$(document).ready(function () {
    $('a').on('click', function () {
        $('head').append('&ltscript&gtconsole.log("running")&lt/script&gt');
    });
});