i make a jquery function and called it by linking.
<a href="javascript:myfunc(ID)"></a>
and i want to check in my function that button is second time click or first time
and i want to make different different event on first and second click()
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
.toggle(), like this:You can add as many as you want actually, it just cycles through them, If you need to bomb out after the second click, just
.unbind()by adding a$(this).unbind('click')at the bottom of the last click function, like this: