solo es cuestion de que cambies el innerHTML donde quieres que se actualice. credits.innerHTML=credit; ejemplo: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> var credit = 0; function addCredit(){ credit = credit + 1; credits.innerHTML=credit; } addCredit(); <!-- language: lang-html --> <p>Créditos <span id='credits'></span><p> <button onclick="addCredit()">Free Credits</button> <!-- end snippet -->