<html>
<head>
<style>
</style>
</head>
<body>
<span id="num">50</span>
<a href=""> link </a>
<a href=""> link </a>
<a href=""> link </a>
<a href=""> link </a>
<a href=""> link </a>
<a href=""> link </a>
<a href=""> link </a>
<script>
f = function(event){
event.preventDefault()
if(this.clicked) {this.clicked = false; num.innerHTML = (+num.innerHTML) - 1; return}
this.clicked = true; num.innerHTML = (+num.innerHTML) + 1
}
;[].forEach.call(document.querySelectorAll("a"),function(a){
a.onclick = f
})
</script>
</body>
</html>