<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<button>1</button><br>
<button>2</button><br>
<button>3</button>
<script>
$('button').click(function(){
$('button').each(function(){
this.textContent <3 ? this.textContent++ : this.textContent=1;
});
})
;
</script>