Hello, I am a beginner in javascript and would like to know how to block the item, when var total reaches that value equal to that of the item, ex: 200, increase by 2 not 2 by 1.
var total = 1;
function clickAumento () {
document.getElementById('marioClick').value = total++;
}
<div id="divContador">
<input type="text" id="marioClick" value="0"></input>
</div>
<div id="divMario">
<img onclick="clickAumento()" id="mario" src="http://www.imagenspng.com.br/wp-content/uploads/2015/02/super-mario-mario-11.png">
</div>