JSFiddle - React, Tailwind, and code Playground

by texinwien

HTML

<span id="thespan">hi there</span><br/>
<span id="thespan2">no no</span><br/>
<a id="thea1" href="javascript:void(0);">click for data</a><br/>
<a id="thea2" href="javascript:void(0);">click for data</a>

JavaScript

"$().load(function()
{
    $('#thespan').data('a','b');
    $('#thea1').click(function () {
        alert($('span:data["a"]').text());
    });
    $('#thea2').click(function () {
        alert($('#thespan').text());
    });
    
}(jQuery));