<div id="counter">0</div>
document.onclick = function () { var node = document.getElementById('counter'); node.innerHTML = parseInt(node.innerHTML) + 1 }