I am making a game with javascript where you can buy fish and I am trying to figure out how to make it so that when function agf() is executed the number in <p id="money">10</p> is subtracted by 2. So far I have tried:
var m=document.getElementById('money').value;
function agf() {
if(m>1) {
var pay=(m-2);
document.getElementById('money').innerhtml=pay;