JSFiddle - React, Tailwind, and code Playground

by Gerónimo Garcia Sgritta

HTML

<a href="#" onclick="alert('something');yourFunction();">Click</a>

<div id="yourdiv">Click on the link above and I will go away forever! Muhahaha</div>

CSS

#yourdiv {
    display: block; /* Rather than an equals sign, CSS uses colons
    This actually isn't needed because my default divs have display: block ;) */
}

JavaScript

function yourFunction()
{
    alert('a');
    //var el = document.getElementById("yourdiv");
    //alert(el.innerHTML);
    //evt.preventDefault(); // So the link doesn't follow through to "#"
    //return false;
}