Change the button's function with jQuery? -
This may be a silly question but I can not find it right I can change the function of the button with the usual javascript, But not with jQuery I'm aiming for a very simple text-size button, this button needs two different functions; One that makes the text bigger and changes the click function on other functions, and it makes the other function lessen the text and changes the click function on the first function. Since the same button will be used to increase or decrease both ends, I need it to work. I am currently working on a school project and we only use jQuery / jQuery UI for this assignment. Will happen.
With the usual JavaScript, something like this will happen:
var button = document.getElementById ('click-button'); button. Click = First Click; Function firstClick () {button.onclick = secondClick; } Function secondClick () {button.onclick = firstClick; } How do I get the same thing with jQuery?
Something like the code below will work.
$ ("#click-button"). ('Click', first click) function firstClick () {warning ("first click"); $ ("#click-button") close ('click'). ('Click', secondclick)} function secondClick () {warning ("second click"); (Click 'Click', first click)} Here's an example of working:
Comments
Post a Comment