-3
I’m not getting to increment the variable with each click on one button.
Example: a Button and a Paragraph, every click on button, increase the value in Paragraph, example, from 0 to 1, and each click increments one.
function criaCounter(init) {
var count = init || 0;
return function() {
count++;
alert(count);
}
}
$('#addCount').click(criaCounter(5));