This may be a stupid question, but I just can't understand. I can change the button function using normal JavaScript, but not with jQuery. I am aiming for a very simple text resize button. This button requires two different functions; one that makes the text bigger and changes the click function to another function, and this other function reduces the text and again changes the click function to the first function. Since the same button will be used to both enlarge and shorten the sixe text, I need this to work. I am currently working on a school project, and for this purpose we should use only jQuery / jQuery UI.
With regular JavaScript, it would be something like this:
var button = document.getElementById('click-button'); button.onclick = firstClick; function firstClick (){ button.onclick=secondClick; } function secondClick(){ button.onclick=firstClick; }
How to achieve the same result using jQuery?
source share