the function to be done is
at first, only one block content is displayed 1
then when you press the add button, the same block will be added and the number displayed in the block content will increase by 2
.continue to add 3, 4, 5.
the problem encountered is that I don"t know how to increase the number displayed in the block after adding the block. Please help me to see how to change it
.Source code:
$(".container").on("click", ".addNewBlock", function(e) {
var content = [];
//
var num = 1 ;
content.push("<div>"+num+"</div>")
$(this).parents(".container").append(content.join(""));
});