Answers for "how to make a button jump between two functions when clicked in javascript"

0

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 ()
Posted by: Guest on July-06-2020

Code answers related to "how to make a button jump between two functions when clicked in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language