1
I wonder if there is any way to implement an alternate call in the function onclick
, so that when I click once it performs a function, and when I click again call another function ...
An example would be using a checkbox
. When I click the first time it displays a message "You have selected this option" and makes an addition calculation, then if I click again it appears a message "You have unchecked this option", and do a subtraction calculation...
The checkbox usually does not work like this, but could also be for example a simple on and off button.
Finally, I would like to know if it is possible to perform this alternation using the onclick
and how it would be.
Thank you.