JSFiddle - React, Tailwind, and code Playground
HTML
<span id="thespan">Hello! This is text.</span>
JavaScript
var theSpan = document.getElementById("thespan");
theSpan.addEventListener('click', function() { alert("You clicked!")}, false);
<span id="thespan">Hello! This is text.</span>
var theSpan = document.getElementById("thespan");
theSpan.addEventListener('click', function() { alert("You clicked!")}, false);