Hello people, as you can see on the page, there is a button, in which I click and increase the variable credit
that is shown in the console, but what I want is that this variable also increases where the number is 1 that is on the page next to credits, since the variable is not updated, this is the script:
<script>
var credit = 0;
function addCredit(){
credit = credit + 1;
}
addCredit();
document.write("Creditos ", credit);
</script>
And the button:
<button onclick="addCredit()">Free Credits</button>
It would be a great help who would answer me about the problem, I am new to programming.