<button id="button">Жми!</button>
<script>
var button = document.getElementById('button');
var actions = {
1: function() {
alert('Действие 1');
},
2: function() {
alert('Действие 2');
}
};
var counter = 0;
button.onclick = function() {
actions[counter = (counter % 2) + 1]();
}
</script>