JSFiddle - React, Tailwind, and code Playground

by Alexandre Azevedo

HTML

<div id="codeWrapper">
     <div id="firstCode">Adsense code here</div>
 </div>

JavaScript

$("#firstCode").click(function () {
        var date = new Date();
        var h = "24";
        date.setTime(date.getTime() + (h * 60 * 60 * 1000));
        setCookie('clicked', 'true', {expires: date, path: '/'});

        $(this).parent().remove();
});

function setCookie(cname, cvalue, exdays) {
    document.cookie = cname + "=" + cvalue + "; " + exdays.expires;
}