JSFiddle - React, Tailwind, and code Playground
HTML
<input type="test" id="textUl" />
<button id="appendButton">Incrementar</button>
<ul class="listLi" id="lista"><span id="numero_elementos"></span></ul>
JavaScript
$('#appendButton').click(function(){
var text = $('#textUl').val();
if(text.length){
$('<li />', {html: text, href: text}).appendTo('ul.listLi')
$("#numero_elementos").html($("#lista li").size());
}
});