JSFiddle - React, Tailwind, and code Playground

HTML

<div id="foo"></div>
<a href="#" id="changeData">change data value</a>

JavaScript

$('#foo').data('helptext', 'Old text');
console.log($('#foo').data('helptext'));

$('#changeData').click(function() {
    $('#foo').data('helptext', 'Testing 123');
    console.log($('#foo').data('helptext'));
});