I have jQuery even on button click:
$('button.btn').on('click', function(form)
Sample Exising button after page load:
<button id="5" class="yellow-button btn">Odpublicznij</button>
Works perfectly to all buttons with class btn
But then onclick after ajax request it adds new button to html
content += '<button id="' + comments[i].id + '" class="green-button btn">Upublicznij</button>';
It adds new button like:
<button id="11" class="yellow-button btn">Odpublicznij</button>
And this new button doesn't run this even $('button.btn').on('click', function(form)
.
And I need it to have this event, not to just be here as a button that doesn't do anything