JSFiddle - React, Tailwind, and code Playground
by Akram kamal
HTML
<div>
</div>
<button>Add</button>
JavaScript
$(function(){
var ids = new Array();
$('button').click(function(){
var id = "Page"+$('div p').size();
ids.push(id);
$('div').append('<p id="'+id+'">'+id+'</p>');
var str = '';
$.each(ids, function(i,v){
str = str + 'ID'+i+' is '+ v + '\n';
});
alert(str);
});
});