<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<button id="button">Жми!</button>
<script>
var a = {
0: function () {
alert('Действие 1')
},
1: function () {
alert('Действие 2')
}
}, b = -1;
document.getElementById("button").onclick = function () {
a[++b % 2]()
};
</script>
</body>
</html>