<div id = "counterContainer" style="float: left;">0</div> <span onclick="counter()" style="cursor: pointer; margin-left: 10px;">Проголосуй!</span>
<script>
function makeCounter() {
var currentCount = 0, counterContainer = document.getElementById('counterContainer');
return function() {
currentCount++;
counterContainer.innerHTML = currentCount;
return currentCount;
};
}
var counter = makeCounter();
</script>