JSFiddle - React, Tailwind, and code Playground

by floor_

HTML

<div class="plant-name">foo</div>
<button class="btn">button</button>

JavaScript

var plant_counter = 0;
    
$( document ).ready(function() {
    $('.plant-name').attr('id', 'plant-name-' + plant_counter);
    $('.btn').click (function () {
        $('#plant-name-0').text('hello');
        console.log('clicked');
    });
       console.log("ready");
});