how to make a button jump between two functions when clicked in javascript
function buttonClick() {
//do stuff
this.onclick = notButtonClick; //function reference to nBC
}
function notButtonClick() {
//do more stuff
this.onclick = buttonClick; //function reference to original function
}
var el = document.getElementById("numberonebutton"); //let for ES6 aficionados
el.onclick = buttonClick; //again, function reference, no ()