JSFiddle - React, Tailwind, and code Playground
HTML
<div id="foo" data-helptext="bar"></div>
<a href="#" id="changeData">change data value</a>
JavaScript
console.log($('#foo').data('helptext'));
$('#changeData').click(function() {
$('#foo').data('helptext', 'Testing 123');
// $('#foo').attr('data-helptext', 'Testing 123');
console.log($('#foo').data('data-helptext'));
return false;
});