JSFiddle - React, Tailwind, and code Playground

HTML

<input id="Ajout" type="button" onclick="$();" value="Ajout" />
 <input id="Alert" type="button" onclick="$();" value="Alert" /> 
 
 <div id="myText"> 
    <ul id="myList">
    </ul>
</div>

CSS

#myText {
    margin:0;
    padding:0;
    border:0;
    left:0;
    max-width: 260px;
    height:246px;
    background:yellow;
    word-wrap: break-word;
    font-size: 18px;
    line-height: 1.4em;
    overflow: hidden;
}

JavaScript

$("#Ajout").on("click", function () { 

$("#myList").append($("<li>").attr('class', 'myEl').text("rrrr")); 

 });
 
 
 
 $(".myEl").on("click", function () { 
alert("ok");
 });