I have the HTML
<input type="button" class="btnx" value="click me">
and the attached JS file
$(".btnx").on("click",function(){
var newbtn = "<input type='button' class='btnx' value='click me'>";
$('body').append(newbtn);
});
When I click on the button 1 new buttons are append to the body, but when I click on the new buttons(button 2 or button 3) why no more buttons are formed.
I googled and found to use ".on()" but still can't figure out why it is not working.
JSFiddle link: https://jsfiddle.net/93k9emL1/