JSFiddle - React, Tailwind, and code Playground

HTML

<p id="test" data-height="test1">Test1</p>

<button class="change">Click</button>

JavaScript

$('.change').on('click', function(){
    $('#test').prop('data-height', 'test2');
    )};