I'm trying to simply increment the number in a h1 tag by 100 when a button is clicked. I was able to get it to increment by 1 using the ++ operator but when I tried using the += operator to increment by 100 it places the value beside the initial one and does this every click, why is this happening?
Here is my code:
function Cash() {
var x = document.getElementById("money").innerHTML;
x += 100;
document.getElementById("money").innerHTML = x;
}
<div class="col-6 balance">
<h1 id="money" value="0">0</h1>
</div>
<button onclick="Cash()">Increase</button>