I have made this script, but there is a problem.
When i click addbutton
the variable on console log recieve the update (1, 2 ,3 ,4) for every click.
But var fieldHTML
remains 1 forever, why?
var a = 1;
$(addButton).click(function(){ //Once add button is clicked
a++;
console.log(a);
});
var fieldHTML = a;