JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<p data-ref="a custom data attribute.">Click for the custom data!</p>

JavaScript

$('p[data-ref]').click(
    function(){
        alert($(this).attr('data-ref'));
    });