JSFiddle - React, Tailwind, and code Playground

by tamtakoe

HTML

<button>test</button>
<ul>
    <li>
        <a href="#">1</a>
    </li>
</ul>

JavaScript

$('ul').on("click", "li a:last", function(event) {
    alert("test");
});

$('button').click(function() {
    var $this = $('ul'),
    cnt = $this.children().length;
    $('<li><a href="#" /></li>').find('a').html(cnt + 1).end().appendTo($this);
});