I am creating a jquery function and linking it.
& lt; A href = "javascript: myfunc (id)" & gt; & Lt; / A & gt; And I want to check in my function that the button is clicked for the second time or first time
and I want to create separate events on the first and second clicks ()
You can use it:
$ ("# MyButton "). Toggle (function () {// click oe}, function () {// two click}}; You can actually add as many as you like, this is just the cycle through them, if you need to add a bom by adding the $ (this) after the second click At the bottom of the last click function, unbind ('click') like this:
$ ("# myButton"). Toggle (function () {// click oe}, function () {// click two $ (this). Unbund ('click'); // Without it, it goes back to the first function on the next click)} ;
Comments
Post a Comment